I have following string
Casas (3)
I want to get the number three out of it .
in Jquery I am using this regex
regExp = /\(([^)]+)\)/;
But i dont know how to do that in PHP
Thanks in advance
I have following string
Casas (3)
I want to get the number three out of it .
in Jquery I am using this regex
regExp = /\(([^)]+)\)/;
But i dont know how to do that in PHP
Thanks in advance
Try this
$str = "Casas (3)";
preg_match_all('!\d+!', $str, $matches);
print_r($matches);