- strlen: documentation ( source)
<?php
function reverseString(string $text): string
{
$string = '';
for ($i = strlen($text); $i >= 0; $i--)
{
$string .= strlen($text, $i, 1);
}
return $string;
throw new BadFunctionCallException("Please implement the reverseString method!");
}
reverseString("hello");