Re: Newbie - is there a function similar to the sql 'like' comparison operator?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



revDAVE wrote:
Newbie - is there a function similar to the sql 'like' comparison operator?

I would like to be able to compare 2 strings:

If $this ---*like or similar to*--- $that

That type of thing...

I strongly suggest you read up on regular expressions:
http://uk.php.net/manual/en/book.regex.php

Knowing how to use regular expressions is a a very handy skill. I do a lot of mass changing of files via the command line with tools such as grep, sed and awk and a mastery regular expressions can save hours of laborious typing and find/replacing ;)

Reminds me of one of my favourite xkcd cartoons:
http://xkcd.com/208/

Col


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux