I have the following line and you want to use str_replace or preg_replace to remove the brackets, but I'm not sure how to do this. I was able to remove the opening brackets with str_replace, but I cannot remove the closing brackets.
This sting:
$coords = '(51.50972493425563, -0.1323877295303646)';
I tried:
<?php echo str_replace('(','',$coords); ?>
which removed the opening brackets, but now I feel like I need preg_replace to remove both.
How can I do that?
Help rate
string php preg-replace str-replace
hairynuggets
source share