"I have only proved my code correct, not tested it" - Donald Knuth
Search This Blog
Friday, August 14, 2009
PHP, Reverse String
$s = "live"; print("revese of live is: ");
//str_split — Convert a string to an array $array = str_split($s); //echo strlen($s); //or use sizeof on an array for ($i= sizeof($array)-1; $i>-1; --$i){ print($array[$i]); } print("\n");
No comments:
Post a Comment