this is my string: http://www.something.com/path/tt0425235/somethingelse/
and i need to get just "0425235" (Beetween "tt" and "/")
Test with:http://rubular.com/
this is my string: http://www.something.com/path/tt0425235/somethingelse/
and i need to get just "0425235" (Beetween "tt" and "/")
Test with:http://rubular.com/
Simple and perfect ;)
<?php
$match = array();
$url = 'http://www.something.com/path/tt0425235/somethingelse/bla/bla/bla/bla/?bla=bla';
preg_match( '/\/path\/([a-z]+([\d]+))+\/?/i' , $url , $match );
print_r( $match );
?>
Bye!