我有那个代码,我想将结果限制为最多 10 个。我怎样才能做到这一点?
<?php
$actors = rtrim($movie_info[0]->actors, ", ");
if(stristr($actors, ",")) {
$actors = explode(",", $actors);
array_walk($actors, 'add_url_on_tags', '/actor');
echo ul($actors, array("class" => "genres2"));
echo '<div style="clear:both;"></div>';
}elseif(!empty($actors)) {
echo '<a href="/actor/'.url_title($actors).'">'.$actors.'</a><br />';
}else{
echo 'empty';
}
?>
感谢您的帮助!