explode() 字符串转换数组

explode() 函数把字符串分割为数组。

语法

explode(separator,string,limit)

例子:

$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.
)

posted @ 2016-09-01 10:06  chinalorin'blogs  阅读(596)  评论(0编辑  收藏  举报