View Full Version : what does this php code mean??
11-05-2010, 04:38 PM
if (preg_match('/top\.location\.replace\(\"http\:\/\/www\.bebo\.com\/SignIn\.jsp"\)/i', $data, $matches)) return false;
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).
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.