★ wanayoo — archive 1999 http://www.php.net/manual/function.strcasecmp.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Strings
Quick Reference
German version of this pageJapanese version of this pageItalian version of this pageFrench version of this pageHungarian version of this page
Strings
* AddCSlashes
* AddSlashes
* bin2hex
* Chop
* Chr
* chunk_split
* convert_cyr_string
* count_chars
* crc32
* crypt
* echo
* explode
* flush
* get_html_translation_table
* get_meta_tags
* hebrev
* hebrevc
* htmlentities
* htmlspecialchars
* implode
* join
* levenshtein
* ltrim
* md5
* Metaphone
* nl2br
* ob_start
* ob_get_contents
* ob_end_flush
* ob_end_clean
* ob_implicit_flush
* Ord
* parse_str
* print
* printf
* quoted_printable_decode
* quotemeta
* rtrim
* sscanf
* setlocale
* similar_text
* soundex
* sprintf
* strcasecmp
* strchr
* strcmp
* strcspn
* strip_tags
* stripcslashes
* stripslashes
* stristr
* strlen
* str_pad
* strpos
* strrchr
* str_repeat
* strrev
* strrpos
* strspn
* strstr
* strtok
* strtolower
* strtoupper
* str_replace
* strtr
* substr
* substr_count
* substr_replace
* trim
* ucfirst
* ucwords
Manual: strcasecmp
View the source code for this pageSearch the site



Previous page
 sprintf
 Updated
Sat, 12 Aug 2000
strchr 
Next page


strcasecmp

(PHP3 >= 3.0.2, PHP4 )

strcasecmp --  Binary safe case-insensitive string comparison

Description

int strcasecmp (string str1, string str2)

Returns < 0 if str1 is less than str2; > 0 if str1 is greater than str2, and 0 if they are equal.

Example 1. strcasecmp() example


$var1 = "Hello";
$var2 = "hello";
if (!strcasecmp ($var1, $var2)) {
    echo '$var1 is equal to $var2 in a case-insensitive string comparison';
}
      

See also ereg(), strcmp(), substr(), stristr(), and strstr().


User Contributed Notes: strcasecmp


cleong@organic.com
11-May-2000 08:50
Note that the behavior of strcasecmp() if different from that of strcmp().

<pre>
strcmp("Z", "AAA") = 1
strcmp("Z", "A") = 1
strcasecmp("Z", "AAA") = -2
strcasecmp("Z", "A") = 25
</pre>



 About Notes


Previous page
 sprintf
 Updated
Sat, 12 Aug 2000
strchr 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.