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

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -