Re: Newbie - is there a function similar to the sql 'like' comparison operator?
| From: | Kalle Sommer Nielsen | Date: | Thu, 08 May 2008 15:30:16 +0000 |
| Subject: | Re: Newbie - is there a function similar to the sql 'like' comparison operator? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-274031@lists.php.net to get a copy of this message | ||
Hi RevDave
Theres the similar_text() function which calculates the procentage of te similarity between
two strings.
If your looking for a check to see if a string has some specified text then use the strpos()
function and then the identical comparison operator to check for true and false
Kalle Sommer Nielsen
DR - www.dr.dk
----- Original Message ----- From: "revDAVE" <Cool@hosting4days.com>
To: "PHP General" <php-general@lists.php.net>
Sent: Thursday, May 08, 2008 5:20 PM
Subject: [PHP] Newbie - is there a function similar to the sql 'like' comparison operator?
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 know of this page: http://us3.php.net/manual/sl/language.operators.comparison.php But I don't see something 'like' or 'similar' to something else -- Thanks - RevDave Cool @ hosting4days . com [db-lists] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.10/1421 - Release Date: 07-05-2008 17:23