<?php $text = 'This is (foo)((bar))'; $text = strtr($text, array('(' => '<del>', ')' => '</del>', '((' => '<ins>', '))' => '</ins>')); echo $text . "\n"; $text = 'This is (foo)((bar))'; $text = preg_replace('/(?<!\()\((?!\()([^)]*)\)/', '<del>$1</del>', $text); $text = preg_replace('/\(\(([^)]*)\)\)/', '<ins>$1</ins>', $text); echo $text . "\n";
You have javascript disabled. You will not be able to edit any code.