反转一个英文句子中的单词,并且对应位置大小写不改变
<?php // your code goes here function strreverse($str){ $strlower=strtolower($str); $tmpstr=implode(" ",array_map('reverse',explode(" ",$strlower))); $strlen=strlen($str); while($strlen>0){ if($str[$strlen-1]>64 && $str[$strlen-1]<92){ $tmpstr[$strlen-1]=$tmpstr[$strlen-1]+32; } $strlen--; } } $str1="This is an Apple on eBay" print(strreverse($str1)); ?>