Jump to content

[SOLVED] Remove text INCLUDING '(' character


solarisuser

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.