//第一
$s = "I am student";
$arr = explode(' ',$s);
$arr = array_reverse($arr);
$s = implode(' ',$arr);
print $s;
//第二
$str = "I am student";
$str_new= '';
$arr = explode(' ',$str);
for($i=count($arr);$i>-1;$i--){
$i == 0? $str_new .= $arr[$i]:$str_new .= $arr[$i].' ';
}
echo $str_new;
$s = "I am student";
$arr = explode(' ',$s);
$arr = array_reverse($arr);
$s = implode(' ',$arr);
print $s;
//第二
$str = "I am student";
$str_new= '';
$arr = explode(' ',$str);
for($i=count($arr);$i>-1;$i--){
$i == 0? $str_new .= $arr[$i]:$str_new .= $arr[$i].' ';
}
echo $str_new;