milo.desert Posted August 7, 2007 Share Posted August 7, 2007 $string = "Outside (Inside)"; i want replace text in "()" - include bracket by other words how can i write preg code? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 7, 2007 Share Posted August 7, 2007 <?php $string = "Outside (Inside)"; $newword = "nascar is rubbish"; $string = preg_replace('/\((.*)\)/',$newword,$string); echo $string; ?. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.