|
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net
[Spis]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[K]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[X]
[W]
[Z]
strtolower (PHP 3, PHP 4, PHP 5) strtolower -- Make a string lowercase Descriptionstring 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.
Przykład 1. strtolower() example |
<?php
$str = "Mary Had A Little Lamb and She LOVED It So";
$str = strtolower($str);
echo $str; ?>
|
|
Notatka: Ta funkcja jest bezpieczna dla danych
binarnych.
See also strtoupper(), ucfirst(),
ucwords() and mb_strtolower().
User Contributed NotesPatrick
19-Jan-2006 07:57
If you're considering using the below unhtmlentities function from phpContrib, I would suggest this one as an alternative:
<?php
function unhtmlentities($string)
{
$string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
$string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string);
$trans_tbl = get_html_translation_table(HTML_ENTITIES);
$trans_tbl = array_flip($trans_tbl);
return strtr($string, $trans_tbl);
}
?>
That was copied exactly from the html_entity_decode manual page. It'll handle numeric entities correctly, the below function won't.
fackelkind
11-Jan-2006 09:03
Nifty? :D
<?php
function is_lowercase ($str){
return ($str == strtolower ($str));
}
?>
mhuggins57 at yahoo dot com
20-Jul-2005 01:04
There's a ucfirst "function" to make the first character uppercase, but there's no "lcfirst" function to make the first character lowercase. Here's my own code to accomplish this.
<?
function lcfirst($str) {
return strtolower(substr($str, 0, 1)) . substr($str, 1);
}
?>
I found this particularly useful for generating XML nodes with the Reflection class.
kmcdermott at perimeterinstitute dot ca
08-Dec-2004 10:04
To do case insensitive comparisons in a database, strtolower() can be a quick and dirty solution:
$Sql = "SELECT * FROM tablename WHERE LOWER(column_name) = '".strtolower($my_var)."'";
phpContrib (A T) esurfers d o t c o m
24-Sep-2004 08:07
<?php
$b=html_entity_decode(strtolower(htmlentities($a)));
?>
will convert to lowercase most accented vocals
(it will convert
|