php学习笔记之mb_strstr的基本使用
前言本文主要介绍了关于php之mb_strstr基本使用的相关内容,分享出来供大家参考学习,下面话不多说了,来一起看看详细的介绍吧。 mb_strstr
Description//mb_strstr() finds the first occurrence of needle in haystack and returns the portion of haystack. If needle is not found,it returns FALSE.//mb_strstr() 查找了 needle 在 haystack 中首次的出现并返回 haystack 的一部分。 如果 needle 没有找到,它将返回 FALSE。 Parametershaystack
needle
before_needle
encoding
Return Values
Examples// If set to true,it returns all of haystack from the beginning to the first occurrence of needle. $strstr = mb_strstr( "hello china","ll",true ); echo $strstr . PHP_EOL; //he //* If set to false,it returns all of haystack from the first occurrence of needle to the end,$strstr = mb_strstr( "hello china",false ); //hello china $strstr = mb_strstr( "hello China,hello PHP",true ); $strstr = mb_strstr( "hello China,false ); $strstr = mb_strstr( "PHP是世界上最好的语言😄","最好",true ); 总结以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,如果有疑问大家可以留言交流,谢谢大家对编程之家的支持。 (编辑:成都站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |