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? Link to comment https://forums.phpfreaks.com/topic/63682-about-preg_replace/ 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; ?. Link to comment https://forums.phpfreaks.com/topic/63682-about-preg_replace/#findComment-317402 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.