Quote:
Originally Posted by Brujah
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;
|
ya see the file is full of h3 sections, i wanna specify which one and it will get those links, so its not just 1 h3, u-bobs works for this
its chrome bookmarks, so each folder has a h3 heading for the folder name, just wanna get those links for the h3 folder name.