Home  >  Article  >  php教程  >  substr() explode()函数

substr() explode()函数

WBOY
WBOYOriginal
2016-06-13 11:18:231312browse

 

substr(string,start,length):本函数将字符串 string 的第 start 位起的字符串取出 length 个字符。若 start 为负数,则从字符串尾端算起。若可省略的参数 length 存在,但为负数,则表示取到倒数第 length 个字符。

  $str = "abc|bck|fhq|nui";

   print(explode("|",$srt)); //输出array([0]=>abc,[1]=>bck,[2]=>fhq,[3]=>nui)

?>


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn