php中字符串比较方法
发布时间:2016-10-26 编辑:jiaochengji.com
教程集为您提供php中字符串比较方法等资源,欢迎您收藏本站,我们将为您提供最新的php中字符串比较方法资源
本文章介绍了一两种在php中字符比较方法一种是==号,一种是strcmp函数进行字符串相等比较,有需要的朋友可以参考下。
利用函数strcmp()函数字符串进行比较
int strcmp(string str1,string str2))
参数str1和参数str2制定要比较的两个字符串,如果相等则返回0;如果参数str1大于参数str2则返回值大于0;如果参数str1小于参数str2则返回值小于0。
实例:
<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy1589')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy1589><?http://www.jiaochengji.com/phper/php-function/35413.htm您可能感兴趣的文章:
php字符串查找函数(strrpos与strchr)
php字符串函数有哪些
php字符串比较函数实例
php5 字符串处理函数汇总
php查找字符串中http地址
php寻找两个字符串的相似性的方法
php中字符串比较方法
php 字符串的声明方法
php中字符串比较函数使用方法
php字符串比较与查找方法详解
[关闭]