php replace function Please help Newbie to PHP
Posted: Mon Sep 08, 2003 11:39 am
I need a function that will read the results of a page and replace all ' " ; with a NULL value. I saw this from the php funtion list of php.net:
$match=array("ONE","TWO","THREE");
$replace=array("TWO WORDS","MANY LETTERS","OTHER IDEAS");
$sample="ONE SAMPLE";
echo str_replace($match,$replace,$sample);
Is this correct? I think I need to escape the ' " and the ; but unsure what I need to do.
$match=array("'",""",";");
$replace=array("","","");
$sample="ONE SAMPLE";
echo str_replace($match,$replace,$sample);
Thanks,
Aelaron
$match=array("ONE","TWO","THREE");
$replace=array("TWO WORDS","MANY LETTERS","OTHER IDEAS");
$sample="ONE SAMPLE";
echo str_replace($match,$replace,$sample);
Is this correct? I think I need to escape the ' " and the ; but unsure what I need to do.
$match=array("'",""",";");
$replace=array("","","");
$sample="ONE SAMPLE";
echo str_replace($match,$replace,$sample);
Thanks,
Aelaron