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.
)
时间: 2024-11-11 01:40:00