note 24220 added to function.strtolower
| From: | zaid at designerz dot com | Date: | Fri, 09 Aug 2002 18:47:15 +0000 |
| Subject: | note 24220 added to function.strtolower | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34620@lists.php.net to get a copy of this message | ||
//compare user input with database. Insert the call to the function inside your sql statement
//by zaid@designerz.com
function compare($field_name, $string)
{
$string_lower = strtolower($string); //makes $string all lower case
$string_upper = strtoupper($string); //makes $string all upper case
$string_ucfirst = ucfirst($string_lower); //capitalizes first letter
$string_ucwords = ucwords($string_lower); //converts a whole phrase to first upper
return " ($field_name Like '" . $string . "%' Or $field_name Like
'" . $string_upper . "%' Or $field_name Like '" . $string_ucfirst .
"%' Or $field_name Like '" . $string_ucwords . "%') " ;
}
--
http://www.php.net/manual/en/function.strtolower.php
http://master.php.net/manage/user-notes.php?action=edit+24220
http://master.php.net/manage/user-notes.php?action=delete+24220
http://master.php.net/manage/user-notes.php?action=reject+24220