View Full Version : What does this string mean?

06-29-2010, 09:39 AM
Hi guys..

What does this string mean?


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;


06-29-2010, 12: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

06-29-2010, 12:57 PM
Yup, this is regex.
This searches for

It ignores the case as /i is mentioned.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum