rgb192
asked on
replace query variable
replace
$replace_query_string with ''
website.com/index.php?quer y_variable 1=45&query _variable2 =59499
if $replace_query_string='que ry_variabl e1'
want
website.com/index.php?quer y_variable 2=59499
if $replace_query_string='que ry_variabl e2'
want
website.com/index.php?quer y_variable 1=45&
$replace_query_string with ''
website.com/index.php?quer
if $replace_query_string='que
want
website.com/index.php?quer
if $replace_query_string='que
want
website.com/index.php?quer
ASKER
<?php
$query_string='website.com/index.php?query_variable1=45&query_variable2=59499';
$query_string = preg_replace('#'.preg_quote($replace_query_string,'#').'=[^&]*&?#', '', $query_string);
echo $query_string;
website.com/index.php?quer
want to delete one query_string variable and one query_string value
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
first two solutions worked,
explode & simple and effective
next solution was me realizing different design pattern
thanks
explode & simple and effective
next solution was me realizing different design pattern
thanks
Open in new window
I haven't tested it; let me know if you have any trouble and I'll take another look.