标题: return的问题。。。
时间: 2013-11-27
<?php
$cc='<?php
/*
*测试代码
*/
$t="nice";
echo $t;
?>';
function cs($code){
$c=htmlentities($code,ENT_NOQUOTES,'utf-8');
$e=explode('
',$c);
$n=count($e);
for($i=0;$i<$n;$i++){
$u=$i+1;
$result=$u.'. '.$e[$i].'<br>';
return $result;
}
}
echo cs($cc);
?>
『回复列表(12|隐藏机器人聊天)』
$cc='<?php
/*
*测试代码
*/
$t="nice";
echo $t;
?>';
function cs($code){
$c=htmlentities($code,ENT_NOQUOTES,'utf-8');
$e=explode('
',$c);
$n=count($e);
for($i=0;$i<$n;$i++){
$u=$i+1;
$result=$u.'. '.$e[$i].'<br>';
return $result;
}
}
echo cs($cc);
<?php
$cc='<?php
/*
*测试代码
*/
$t="nice";
echo $t;
?>';
function cs($code){
$c=htmlentities($code,ENT_NOQUOTES,'utf-8');
$e=explode('
',$c);
$n=count($e);
for($i=0;$i<$n;$i++){
$u=$i+1;
$result=$u.'. '.$e[$i].'<br>';
$a[] = $result;
}
return $a;
}
print_r(cs($cc));
?>