php explode()返回值

<?php
$str = "abc:def:hij";
$arr = explode(':',$str);
echo '<pre>';
echo '成功<br>';
var_dump($arr);
echo '</pre>';

$str = "abcdefhij";
$arr = explode(':',$str);
echo '<pre>';
echo 'no成功<br>';
var_dump($arr);
echo '</pre>';

  浏览器输出结果:

成功
array(3) {
  [0]=>
  string(3) "abc"
  [1]=>
  string(3) "def"
  [2]=>
  string(3) "hij"
}

no成功
array(1) {
  [0]=>
  string(9) "abcdefhij"
}

  

posted @ 2012-02-28 12:06  myD  阅读(2910)  评论(0编辑  收藏  举报