Find a string within a string

Soldato
Joined
4 Jul 2004
Posts
2,647
Location
aberdeen
Hello
I want to do the following:
Get the referrer
If the referrer includes "google" display $xxx
else display $yyy

How can i check if the referrer has a certain string (ie "google") in it?
All i've got so far is basically "$ref = getenv('HTTP_REFERER');"

(ps: this is in php)
 
Cheers :)
Another Q now:

I want to validate that $foo is in the format of "dd/mm/yy @ hh/mm".

How can i do a simple thing in the basic style of:
if (check($foo, "dd/mm/yy @ hh/mm") == true) {
echo "correct method";
}
else {
echo "sorry you must have entered it wrong etc";
}

(of course mm = numbernumber etc)
 
Back
Top Bottom