View Single Post
Old 08-04-2012, 06:08 AM  
Brujah
Beer Money Baron
 
Brujah's Avatar
 
Industry Role:
Join Date: Jan 2001
Location: brujah / gmail
Posts: 22,157
It displays the first block for me, but all I had to go on was your sample links.txt code above.

Code:
# cat links.txt
<h3>search engine links</h3>
<a href="http://google.com">google</a>
<a href="http://www.bing.com">bing</a>
<a href="http://www.yahoo.com">yahoo</a>
<h3>payment links</h3>
<a href="http://www.paypal.com">paypal</a>
<a href="http://www.paxum.com">paxum</a>
<h3>block three</h3>
<a href="https://gfy.com">gfy</a>
<a href="http://php.net">php</a>

# php test.php

<a href="http://google.com">google</a>
<a href="http://www.bing.com">bing</a>
<a href="http://www.yahoo.com">yahoo</a>


# cat test.php
<?php

$data = file_get_contents('links.txt');
$block = preg_replace( '|.*?</h3>(.*?)<h3>.*|s', '$1', $data );
echo $block;
__________________
Brujah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote