Combing preg-replace commands for HTML

Hi All,

I’m making some BBcode for a textarea. I want to create a mouseover function (french to english) when the form is submitted if a word is marked with BBcode. I think this may be possible by combining ‘preg_replace commands’. But, I have no idea how to do this - or if it is possible.

here is my php code - obviously the html code needs to be combined:

	$passage = preg_replace('/\\[E](.+?)\\[\\/E]/i',
		'<...onMouseover="showtip('"$1"');onMouseout="hidetip()">', $passage);
  // [F=Frenchl]French Word[/F]
  $3 = '#';
  $passage = preg_replace('/\\[Ur](.+?)\\[\\/Ur]/i',
  	  '<a href="$3">$1</a>', $passage);

Any help is appreciated.

Thread Closed.

Question has already been asked here: