regex - how to replace the bracket only with space in php for the image name -


my text variable

$text="518609136buddha_flag-copy-(copy)1.jpg"; 

i want replace ( ) space

"518609136buddha_flag-copy- copy 1.jpg" 

i use

$text=preg_replace('/[^a-za-z]+/', ' ', $text); 

but output

518609136buddha_flag-copy- copy 1 jpg 

you can use str_replace

   $text="518609136buddha_flag-copy-(copy)1.jpg";    str_replace(array( '(', ')' ), '', $text); 

Comments

Popular posts from this blog

amazon web services - S3 and apache mod_proxy with basic authentication -

How to install ruby on rails -

powershell - This solution contains one or more assemblies targeted for the global assembly cache -