Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-05-2010, 04:38 PM   PM User | #1
kevinkhan
Regular Coder

 
Join Date: Jun 2009
Posts: 350
Thanks: 75
Thanked 0 Times in 0 Posts
kevinkhan is an unknown quantity at this point
what does this php code mean??

PHP Code:
if (preg_match('/top\.location\.replace\(\"http\:\/\/www\.bebo\.com\/SignIn\.jsp"\)/i'$data$matches)) return false
kevinkhan is offline   Reply With Quote
Old 11-05-2010, 05:35 PM   PM User | #2
Keleth
Senior Coder

 
Join Date: Jun 2008
Location: New Jersey
Posts: 2,354
Thanks: 45
Thanked 247 Times in 244 Posts
Keleth is on a distinguished road
Its actually a bit overdone, but... basically it means if 'top.location.replace("http://www.bebo.com/SignIn.jsp")' is in $data, return false.

preg_match is used to do regular expression matches. Given its not actually doing any sort of regex matching, and not using the match data (in this, there is no match data), its actually better to use strpos (or stripos since its set as case insensitive thanks to the i at the end).
Keleth is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:06 PM.


Advertisement
Log in to turn off these ads.