超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<strtokstrtoupper>
Last updated: Fri, 22 Jun 2007

strtolower

(PHP 3, PHP 4 , PHP 5)

strtolower -- Make a string lowercase

Description

string strtolower ( string str)

Returns string with all alphabetic characters converted to lowercase.

Note that 'alphabetic' is determined by the current locale. This means that in i.e. the default "C" locale, characters such as umlaut-A (Ä) will not be converted.

例子 1. strtolower() example

<?php
$str
= "Mary Had A Little Lamb and She LOVED It So";
$str = strtolower($str);
echo
$str; // Prints mary had a little lamb and she loved it so
?>

注: 该函数适用于二进制对象!

See also strtoupper(), ucfirst(), ucwords() and mb_strtolower().




add a note add a note User Contributed Notes
strtolower
zaid at designerz dot com
10-Aug-2002 05:47
//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 . "%') " ;
}

<strtokstrtoupper>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22