explode()函数
将字符串打成数组
<?php
$str = "Hello world. I love Shanghai!";
print_r (explode(" ",$str),0);//返回一条元素
print_r (explode(" ",$str),2);//返回2个记录
print_r (explode(" ",$str),-3);//去除最后3个记录
?>
将字符串打成数组
<?php
$str = "Hello world. I love Shanghai!";
print_r (explode(" ",$str),0);//返回一条元素
print_r (explode(" ",$str),2);//返回2个记录
print_r (explode(" ",$str),-3);//去除最后3个记录
?>