error77
asked on
remove part of string in php
Hi all,
I have a string in a variable and I need to remove the question mark and everything before it.
Here is the string:
/website/docs/Ed/?ref=docu ments
I need to remove the Question mark itself and everything before it.
Hope you can help
Thanks
I have a string in a variable and I need to remove the question mark and everything before it.
Here is the string:
/website/docs/Ed/?ref=docu
I need to remove the Question mark itself and everything before it.
Hope you can help
Thanks
ASKER
hmm it's returning:
bool(false)
Does it matter that the string is an array? There's only 1 instance of the question mark :o/
bool(false)
Does it matter that the string is an array? There's only 1 instance of the question mark :o/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It's still returning:
bool(false)
This is what I'm doing:
$myNewArray = substr(strrchr($myArray[0] , "?"),1);
Then:
var_dump(myNewArray);
I'm I doing this wrong?
Thanks
bool(false)
This is what I'm doing:
$myNewArray = substr(strrchr($myArray[0]
Then:
var_dump(myNewArray);
I'm I doing this wrong?
Thanks
ASKER
OK, this is the contents of the array:
array(4) {
["onene"]=> string(38) "/website/docs/Ed/?ref=doc uments"
["counter"]=> string(1) "0"
["request"]=> string(424) "gfddfg-yE4.ggffJlWfffiJ9"
["ggfTwo"]=> string(199) "\"uid=1223321232&access=5 43%7C2._I5 43tBpygZGg __.340.1qa dgebf3vlgU &expires=1 2965&sig=6 6555544\""
}
Hope this helps
array(4) {
["onene"]=> string(38) "/website/docs/Ed/?ref=doc
["counter"]=> string(1) "0"
["request"]=> string(424) "gfddfg-yE4.ggffJlWfffiJ9"
["ggfTwo"]=> string(199) "\"uid=1223321232&access=5
}
Hope this helps
ASKER
Got it working in the end. Thanks :)
Open in new window