Okay then, next chapter in my quest!! functions!
I have mastered the v basic stuff, ie i have some simple functions that work.
I'm stuck with this one.
function tidyname($var)
{
$var = trim ($var);
$var = ereg_replace("[ )(' '.-]","",$var);
$var = strtolower($var);
$var = ucfirst($var);
echo $var;
return;
}
the program using the function is
include("../include/functions.php");
$firstname = "GreGG<br>";
$lastname = "PR oops<br>";
$nickname = "PPPooo poops sjsjs<br><br>";
echo $firstname;
echo $lastname;
echo $nickname;
tidyname($firstname);
tidyname($lastname);
tidyname($nickname);
echo $firstname;
echo $lastname;
echo $nickname;
the echo line in the function is to give me a peek in side, it shows that the function is working,
however when i print the variables after they have been through the function they are un changed.
i figure i need a line in the function to "save" the $var as $firstname for example