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 Quote Link to comment 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); 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.