SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want to run multipe regex through, however the regex might be empty.

    if you try and do:

    if (ereg("$test2", $str)) {
    etc..

    with $test2 as empty you get an error

    but if i do:

    if ($test2 && ereg("$test2", $str)) {

    i dont.

    Is this because php gets to $test2, realises it is not true and thus stops so never gets to ereg and never gives the error or is something else going on? if what i say is right just a simple "yes" would help stop me worrying!

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    a simple "yes"

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool, thanks.


Bookmarks

Posting Permissions

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