01 <?php
02
03 // declare the URL to get the data
04 $off_site_url = 'http://www.fundisom.com/index.php';
05
06 // open the remote URL for reading
07 $fp = fopen($off_site_url, 'r') or die('Unable to open file '.$off_site.' for reading');
08
09 $buffer = '';
10
11 // read in chunks
12 while(!feof($fp))
13 {
14 $buffer .= fgets($fp, 4096);
15 }
16
17 // strip HTML but leave the tags you want
18 $output = strip_tags($buffer,'<a><ul><li><h2><h1><span>');
19
20 // convert all whitespace, tabs and newlines into one single whitespace
21 $output = preg_replace('/\s+/', ' ', $output);
22
23 // inject some CSS style
24 $style['<h1>'] = '<h1 style="font-size: 1.2em; padding: 0.5em 0;">';
25 $style['<h2>'] = '<h2 style="font-size: 1em; padding: 0.5em 0;">';
26 $style['<ul>'] = '<ul style="list-style: none;">';
27 $style['<span'] = '<span style="display: none;"';
28
29 $output = strtr($output,$style);
30
31 // display the ripped content
32 echo '<div style="padding: 0.5em">'.$output.'</div>';
33
34 ?>