![PHP Program Reverse the String without Function PHP Program Reverse the String without Function](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXYgsZ9F7C2VQ8iElxgC6yQMRcQ2qDFdXZFkQOkYWEsdKmcIYpi-tCE8NNwFcspv5O-mT0BpmA6JeAPWJXasa-lbozNC_UkRpYxOUP1LJIYykdnE6SGlh7HjW0pAeSNniaZAdCLVWvrCyz/s16000/PHP+Program+Reverse+the+String+without+Function.png)
Write a PHP function FirstReverse(str) take the str parameter being passed and return the string in reversed order.
For Example: if the input string is "Hello World and Coders" then your program should return the string sredoC dna dlroW olleH.
Solution:
function FirstReverse($str) { $result=''; for($i=strlen($str)-1; $i>=0; $i--){ $result = $result.$str[$i]; } return $result; }