Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jun 2009
    Posts
    351
    Thanks
    75
    Thanked 0 Times in 0 Posts

    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

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,546
    Thanks
    45
    Thanked 259 Times in 256 Posts
    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).


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •