Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function reverseString($string){
- $to_return = '';
- $chars = str_split($string);
- $ln = count($chars);
- for($i = $ln - 1; $i>=0; $i--){
- $to_return .= $chars[$i];
- }
- return $to_return;
- }
- echo reverseString("Hello World");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement