#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    21
    Rep Power
    0
    E.g.
    $Agent = getenv(HTTP_USER_AGENT);
    if ($Agent =~ /MSIE/i) callIEfunction;
    else callNSfunction;


    How does pattern matching and split function works in PHP?

    And what about substr($var, $starting, $length)?

    I am new to PHP you see.

    Thanks for your time and patience.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    21
    Rep Power
    0
    Ops sorry, what I meant is how does PHP do pattern matching, split function and substring function.

    Thanks.

    And is there a web site for me to refer to PHP syntax?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Indonesia
    Posts
    87
    Rep Power
    15
    You can take a look at www.php.net
    There's a complete manual there !!!

    See ya !!!

    ------------------
    ** It's the world of Oscario **
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    Singapore
    Posts
    21
    Rep Power
    0
    Ya, I been there. Found out about the split function but pattern matching =~, not yet.

    Meanwhile, I am using the split function, so if the size of array is more than 1, then there is a match!
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    300
    Rep Power
    15
    You don't have the Perl binding operator in PHP. What you do have is the ereg() function. It is basically the same thing. You use it as follows:

    ereg($pattern,$string,$matches)

    If you want case-insensitive matches (like Perl's i option), you use the eregi() function. You should check the manual for further details, under the "Regular Expressions" section.

Similar Threads

  1. Uploading Files
    By vivekjain in forum ASP Programming
    Replies: 0
    Last Post: February 16th, 2004, 11:21 PM
  2. How to see the Memory used by a PHP script?
    By Pardall in forum PHP Development
    Replies: 4
    Last Post: February 13th, 2004, 03:54 PM
  3. Replies: 5
    Last Post: February 11th, 2004, 02:18 AM
  4. Replies: 0
    Last Post: February 10th, 2004, 11:44 PM
  5. PHP Mail Function
    By yoey2000 in forum PHP Development
    Replies: 2
    Last Post: February 6th, 2004, 10:28 AM

IMN logo majestic logo threadwatch logo seochat tools logo