Find in URL

Hello,

Sample: /page.php?test1=5&test2=3&test3=5&test4=78…

URL in test3 value 5
$new_value = 4;
Change if the new value is small

Can you help me

Ask a coherent question AND show attempts that you have tried.

I solved the problem

Thanks
[php]
function get_string_between($string, $start, $end){
$string = ’ ’ . $string;
$ini = strpos($string, $start);
if ($ini == 0) return ‘’;
$ini += strlen($start);
$len = strpos($string, $end, $ini) - $ini;
return substr($string, $ini, $len);
}

$fullstring = $_SERVER[‘REQUEST_URI’];
$parsed = get_string_between($fullstring, ‘test3=’, ‘&’);

echo $parsed; // (result = dog)
[/php]

Seems like a long route for a get variable.

[member=49291]Adem[/member] , learn the basics.

[php]echo $_GET[‘test3’];[/php]

That’s when one does a face slap to oneself when realizing you took the wrong route and feel 2 feet tall. ;D

(I also wonder if he’ll will read the reply?)

I want the 30 seconds back I lost reading the question.

I apologize,
I did not ever think
$_GET[‘test3’]

Sponsor our Newsletter | Privacy Policy | Terms of Service