August 17th, 2000, 03:11 PM
$Agent = getenv(HTTP_USER_AGENT);
if ($Agent =~ /MSIE/i) callIEfunction;
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.
August 17th, 2000, 03:18 PM
Ops sorry, what I meant is how does PHP do pattern matching, split function and substring function.
And is there a web site for me to refer to PHP syntax?
August 17th, 2000, 09:03 PM
You can take a look at www.php.net
There's a complete manual there !!!
See ya !!!
** It's the world of Oscario **
August 17th, 2000, 09:17 PM
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!
August 18th, 2000, 01:58 AM
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:
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.