solarisuser Posted March 22, 2007 Share Posted March 22, 2007 Hi All, Here is my current code $name2 = $data[name]; $patterns[0] = '/\(....\)/'; $replacements[0] = ''; $name3 = preg_replace($patterns, $replacements, $name2); Pretty much I used periods because nothing else worked, but the problem is the number of characters can be more or less than four between the brackets. $data[name] would look like this: Bob Johnson (Cool Guy) How can I remove everything between the brakets INCLUDING the ( and )? Thanks Link to comment https://forums.phpfreaks.com/topic/43863-solved-remove-text-including-character/ Share on other sites More sharing options...
Glyde Posted March 22, 2007 Share Posted March 22, 2007 $name2 = $data['name']; $patterns[0] = "/(\(.+?\))/"; $replacements[0] = ""; $name3 = preg_replace($patterns, $replacements, $name2); Link to comment https://forums.phpfreaks.com/topic/43863-solved-remove-text-including-character/#findComment-213050 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.