...

View Full Version : what does this php code mean??



kevinkhan
11-05-2010, 04:38 PM
if (preg_match('/top\.location\.replace\(\"http\:\/\/www\.bebo\.com\/SignIn\.jsp"\)/i', $data, $matches)) return false;

Keleth
11-05-2010, 05:35 PM
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).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum