Advertisement
primoashbee

Application for Senior PHP Developer

Feb 13th, 2024 (edited)
625
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | Source Code | 1 0
  1. <?php
  2.  
  3.     function reverseStringToHireAshbee(string $string)
  4.     {
  5.         $length = strlen($string);
  6.         $reversedString = "";
  7.         for($x = $length - 1; $x >= 0; $x--)
  8.         {
  9.             $reversedString.=$string[$x];
  10.         }
  11.         return $reversedString;
  12.     }
  13.  
  14.     echo reverseStringToHireAshbee('reverse');
  15.  
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement