...

View Full Version : What does this string mean?



kevinkhan
06-29-2010, 10:39 AM
Hi guys..

What does this string mean?


'/top\.location\.replace\(\"http\:\/\/www\.bebo\.com\/SignIn\.jsp"\)/i'

i found it in this piece of code


if (preg_match('/top\.location\.replace\(\"http\:\/\/www\.bebo\.com\/SignIn\.jsp"\)/i', $data, $matches)) return false;

Thanks

xconspirisist
06-29-2010, 01:17 PM
That string is a regular expression (aka: regex). It is used to check if a string conforms to a defined format.

The PHP manual has excellent documentation on the subject; http://uk.php.net/manual/en/book.regex.php

The function you see in the second code example takes the regex and essentially "searches" the string. More information on the preg_match function can be found in the PHP manual again: http://uk.php.net/manual/en/function.preg-match.php

kar2905
06-29-2010, 01:57 PM
Yup, this is regex.
This searches for
top.location.replace("http://www.bebo.com/SigIn.jsp")

It ignores the case as /i is mentioned.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum