in the previous article, we learned about method of splicing two strings. if necessary, please read "teach you how to use php operators splice strings together< a>". today will learn compare strings, let’s together! < p> string comparison is a common operation in string processing. there are many ways php. this article introduce three methods through code examples: use operators: built-in function strcmp()< p>< li> strcasecmp()< ul> 1. using operator strong>< can (double equal sign) or (three for equality. output result: the difference between ##="= < comparing identity operator, look see (expressions constants) value have type, i.e. both all integers so on. contain otherwise false. blockquote>we <="$"
="==
" yahei, hiragino sans gb, helvetica, helvetica neue, 微软雅黑, tahoma, arial, sans-serif"> < span>< code>="==
,>
,etc.
< p>"; }else{ "两个字符串不相等
"; } ?>< pre>
< >两个字符串相等 两个字符串相等< div>" and code> does not types, triple sign="==," it convert types; p>when using equality (="==)" comparison, if values are same (it only compares variables value, data type), returns true value; are same, false value.
(less than) code>>
(greater size code>
"; 小
"; if($str1<$str2){ p>output