Skip to content

Instantly share code, notes, and snippets.

@otanodesignco
Created June 20, 2013 16:03
Show Gist options
  • Save otanodesignco/5824119 to your computer and use it in GitHub Desktop.
Save otanodesignco/5824119 to your computer and use it in GitHub Desktop.
Pure php implementation of the reverse method from the C++ std.
<?php
function reverse( $text )
{
$txtLen = strlen( $text );
$rtn = "";
for ( $i = $txtLen - 1; $i >= 0; $i-- )
{
$rtn .= $text{$i};
}
return $rtn;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment