Xampp for Win & Xammp for Linux
Posted: 19. April 2008 14:57
Hi. Following php script is working at Xampp for windows but it isn't working at Xampp for linux. Also this script hasn't worked at linux based os. Freebsd, pardus etc. And php is crashed.
Thanks for your help.
Thanks for your help.
- Code: Select all
<?php
function enclose($start, $end1, $end2)
{
return "$start((?:[^$end1]|$end1(?!$end2))*)$end1$end2";
}
$fcont = file_get_contents("http://www.gazi.edu.tr");
$pstring1 = "'[^']*'";
$pstring2 = '"[^"]*"';
$pnstring = "[^'\">]";
$pintag = "(?:$pstring1|$pstring2|$pnstring)*";
$pattrs = "(?:\\s$pintag){0,1}";
$pcomtag = enclose('<!--', '-', '->');
$pscrtag = enclose("<script$pattrs>", "<", "\\/script>");
$pstytag = enclose("<style$pattrs>", "<", "\\/style>");
$pexclude = "(?:$pcomtag|$pscrtag|$pstytag)";
$fcont2 = preg_replace("/$pexclude/iX", '', $fcont);
echo $fcont2;
?>