dexter dexter - 5 months ago 25
PHP Question

how to get last id number from url using php

i want get last id from url,
i have url from text file like this

how to get output

i have this code

$file = fopen("file.txt", "r");
$line = fgets($file);
# do same stuff with the $line

$str = ($line);

if(preg_replace("/.+?\.*/", "$str", $m)){
echo $m[1] .'<br>' ;

but not work


Try this:

$input_value = '';
$last = explode('=', strstr($input_value, '&tid'));
echo $last[1];