Hey peeps
Am trying to turn an HTML file into a string (will use file_get_contents()), and then turn all of the "s into \"s so that I can echo the string.
Having problems with what to put in the pattern and what t put in replace
I have
I don't get an output at all, anyone tell me *** i'm doing wrong? Its probably something simple lol
Am trying to turn an HTML file into a string (will use file_get_contents()), and then turn all of the "s into \"s so that I can echo the string.
Having problems with what to put in the pattern and what t put in replace
I have
PHP:
$file = file_get_contents("file.html");
$pattern = "\"";
$replacement = "\\\"";
echo preg_replace($pattern, $replacement, $file);
I don't get an output at all, anyone tell me *** i'm doing wrong? Its probably something simple lol
