Quote:
Originally Posted by Brujah
assign it to a variable, ex. $link_block
Code:
$link_block = preg_replace( '|.*?</h3>(.*?)<h3>.*|s', '$1', $input );
fwiw, I prefer using xpath too like alcstrategy mentioned, but probably overkill depending on this need.
|
cause the input is coming from file_get_contents
Code:
$data = file_get_contents('links.txt');
$block = preg_replace( '|.*?</h3>(.*?)<h3>.*|s', '$1', $data );
echo $block;
that displays the 3rd link block everytime