PHP interview question description:
For example: my name is fanglor => ym eman si orlgnaf
Answer to PHP interview question:
Copy the code The code is as follows:
function restr ($str)
{
$str1 = explode (' ',$str);
$str2 = '';
$temp = '';
for ($i=0;$i
$str2 . = $temp.strrev ($str1[$i]);
$temp = ' ';
}
return $str2;
}
Copy code The code is as follows:
$str = "my name is fanglor ";
echo restr ($str);
The above introduces the php code. The php code with the alphabetical order reversed and the word order unchanged, including the content of php code. I hope it will be helpful to friends who are interested in PHP tutorials.