I tried creating my own function that will reverse a string. I know I can use strrev(); but that's not fun, and it doesn't teach me anything 
<?
function reverse_string($string, $var2) {
$str_len = strlen($string);
for($i = $str_len; $i >= 0; $i--) {
$var2 .= $string{$i};
}
}
reverse_string("1234567890", $new_string);
echo $newstring;
?>
When I try to echo $newstring, nothing comes up. What am I doing wrong?
<?
function reverse_string($string, $var2) {
$str_len = strlen($string);
for($i = $str_len; $i >= 0; $i--) {
$var2 .= $string{$i};
}
}
reverse_string("1234567890", $new_string);
echo $newstring;
?>
When I try to echo $newstring, nothing comes up. What am I doing wrong?