新聞中心
這里有您想知道的互聯網營銷解決方案
解讀PHP函數explode()的具體使用方法
目前PHP語言算是相當火的一門高級語言。我們可以用它來創(chuàng)建一個高性能的網站等。今天我們?yōu)榇蠹規(guī)淼氖怯嘘PPHP函數explode()的具體用法,希望能對又需要的朋友有所幫助。

#t#PHP函數explode()把字符串分割為數組
explode(separator,string,limit)
separator 必需。規(guī)定在哪里分割字符串。
string 必需。要分割的字符串。
limit 可選。規(guī)定所返回的數組元素的最大數目。
PHP函數explode()例子
- $str = "Hello world. It's a beautiful day.";
- print_r (explode(" ",$str));
- ?>
輸出:
- Array
- (
- [0] => Hello
- [1] => world.
- [2] => It's
- [3] => a
- [4] => beautiful
- [5] => day.
- )
以上代碼示例就是PHP函數explode()的具體使用。
分享文章:解讀PHP函數explode()的具體使用方法
文章來源:http://www.5511xx.com/article/cdppdci.html


咨詢
建站咨詢
