PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have read and re-read tutorials on user defined functions and how to pass values to and from but must have missed something. This code returns an error rather than the string that it reverses. Would appreciate some help.
<?php
/* function to reverse characters in a string */
//
function nameReverse($name){
$newname=strrev($name);
return $newname; //(should return "miJ")
}
//
$name="Jim";
nameReverse($name);
print "the new name is". $newname;
?>