[eluser]basty_dread[/eluser]
hi sophistry.. i just figured out a simple way..
Code:
$appendthis = "<a href='http://codeigniter.com'>"; // this is what i supposed to append after replacing spaces with dash (-)
$string = "the quick brown brown fox jumps over the lazy dog, Brown Fox. <h2>The Brown Fox</h2>";
$save = preg_replace('/(<h.*>(.*)<\/h.*>)/ie',"str_replace(' ','-','QWER$1ASDF')" , $string);
$save = str_replace("QWER",$appendthis,$save); // start of link
$save = str_replace("ASDF","</a>",$save);
print_r($save);
and it worked.. huray!