Global Variable
Posted: Fri Aug 08, 2008 10:08 am
Hello ALL, I am trying to check a string using a function and get out the result of the function.
I can display the result in the function but i need to display it outside the function:
I can display the result in the function but i need to display it outside the function:
Code: Select all
<? $WORD='!"£$%^&*()dsf)(*&^%$£"_+@:';
function CheckWord($ZeWord)
{
$ZeWord=trim($ZeWord);
$ZeWord=strtoupper($ZeWord);
$ZeWord=str_replace(" ","",$ZeWord);
for($i=32; $i<=47; $i=$i+1)
{
$ZeWord=str_replace(chr($i),"",$ZeWord);
}
for($i=58; $i<=64; $i=$i+1)
{
$ZeWord=str_replace(chr($i),"",$ZeWord);
}
for($i=91; $i<=96; $i=$i+1)
{
$ZeWord=str_replace(chr($i),"",$ZeWord);
}
for($i=123; $i<=255; $i=$i+1)
{
$ZeWord=str_replace(chr($i),"",$ZeWord);
}
echo "<br>ZeWord = $ZeWord <br>";//DISPLAYS
}
CheckWord($WORD);
echo "<br>ZeWord = $ZeWord <br>";
?>