nschessnerd 0 Posting Whiz in Training

why does this work?

function restrict($string){
$words = @file('restrict.txt');//found at [url]http://verve2.org/runningStory/restrict.txt[/url]
$me= "(((((())))))))(";
$me = str_replace($words, '',$me);
echo $me;
}

no output

and this not

echo restrict("(((((())))))))(");
function restrict($string){
$words = @file('restrict.txt');
$string = str_replace($words, '',$string);
return $string;
}

output: (((((())))))))(

i noticed on the second one it only does the last element in the array