how to perform this ??

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

how to perform this ??

Post by PHPycho »

Hello forums !!
Consider the following case:

Code: Select all

$ref_url = "http://www.xyz.com";
// or $ref_url = "http://xyz.com" (without 'www')
$check_url = "http://xyz.com/index.php?action=a&mode=b&blabla";
I want to check the if the $check_url contains the $ref_url or not.
Thanks in advance to all of you.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Try strpos().
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

Does your check need to include url validation?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Post Reply