When I execute the following code; I get a seg fault every time! Is this a known bug? How can I make this code work?
<?php
$doc = file_get_contents("http://prairieprogressive.com/");
$replace = array(
"/<script([\s\S])*?<\/ ?script>/",
"/<style([\s\S])*?<\/ ?style>/",
"/<!--([\s\S])*?-->/",
"/\r\n/"
);
$doc = preg_replace($replace,"",$doc);
echo $doc;
?>
The error (obviously) looks like:
[root@localhost 2.0]# php test.php
Segmentation fault (core dumped)