Hi ppl!
I want to strip html sites from the tags, only leaving the data from a <table> entity.
The info i would like to insert into a mysql table.
Have tried to use the following code with various $dokument variables, but it dont
preform as expected.
<?php
$dokument = file("http://localhost/php/index.html");
$search = array ("'<script[^>]*?>.*?</script>'si",
"'<style[^>]*?>.*?</style>'si",
"'<[\/\!]*?[^<>]*?>'si",
"'([\r\n])[\s]+'",
"'&(quot|#34);'i",
"'&(amp|#38);'i",
"'&(lt|#60);'i",
"'&(gt|#62);'i",
"'&(nbsp|#160);'i",
"'&(iexcl|#161);'i",
"'&(cent|#162);'i",
"'&(pound|#163);'i",
"'&(copy|#169);'i",
"'&#(\d+);'e");
$replace = array ("",
"",
"\\1",
"\"",
"&",
"<",
">",
" ",
chr(161),
chr(162),
chr(163),
chr(169)
//,chr(\\1)
);
$test= preg_replace ($search, $replace, $dokument);
echo $test;
php?>
The output of this script comes as:
Array
Stan