码迷,mamicode.com
首页 > Web开发 > 详细

php 字符串是否存在

时间:2015-02-01 20:25:31      阅读:173      评论:0      收藏:0      [点我收藏+]

标签:

	/**
	 * 方法库-字符串是否存在
	 * @param string $str :字符或字符串
	 * @param string $string :字符串
	 * @return string 例子: $str=‘34‘ $string=‘1234‘ 返回 TRUE
	 */
	public function is_str_exist($str, $string) {
		$string = (string) $string;
		$str = (string) $str;
		return strstr($string,$str)===false ? false : true;
	}

  

php 字符串是否存在

标签:

原文地址:http://www.cnblogs.com/jackoogle/p/4265949.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!