Answers for "remove brackets r from string in php"

PHP
1

php remove parentheses and contents from string

$string = "ABC (Test1)";
echo preg_replace("/\([^)]+\)/","",$string); // 'ABC '
Posted by: Guest on June-24-2021
0

remove square brackets from string php

preg_match_all('/\[\[([^\]]+)\]\]/', $yourText, $matches);
foreach($matches as $link) {
   echo $link[1];
}
Posted by: Guest on June-06-2021

Code answers related to "remove brackets r from string in php"

Browse Popular Code Answers by Language