Home > Article > Backend Development > PHP的explode如何才能做到这样子
PHP的explode怎么才能做到这样子?
$userdomain="1,2,3,4,5";
$piece = explode(",", $userdomain);
$name0=$piece[0];
$name1=$piece[1];
$name2=$piece[2];
$name3=$piece[3];
$name4=$piece[4];
echo "$name0 $name1 $name2 $name3 $name4";
这样输出为12345
怎么写,可以输出54321?
当然得保持echo "$name0 $name1 $name2 $name3 $name4";
而不是echo "$name4 $name3 $name2 $name1 $name0";
就是怎么样让explode倒序输出?