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
Post a Comment