Page 1 of 1

easy way to chek if string contains "?" HOW?

Posted: Tue Jul 11, 2006 1:06 pm
by alexus
Hi,
Basically I want to find out if the REQUESTED_URI contains any variables, so I want to see if it has "?" in it.
I got it working w/ foreach() method, but it a bit to slow for some reason, and I dont really need to cycle thwough full string... is there any easier method?


Thnx!

Posted: Tue Jul 11, 2006 1:12 pm
by Luke
strpos()

Posted: Tue Jul 11, 2006 1:13 pm
by RobertGonzalez
I think you can also check against $REQUEST['QUERY_STRING'], but it might not be reliable. For sure, strpos() will tell you if there is a '?' in the string, as long as you tell it the right string to check.