Hi, I have a string Like this:
MyText (1,151)
I would like to get with regex only the value inside (), in this case only: 1,151.
I know it is simple but I am not good with regex.
Thanks!
Hi, I have a string Like this:
MyText (1,151)
I would like to get with regex only the value inside (), in this case only: 1,151.
I know it is simple but I am not good with regex.
Thanks!
This will work:
if (preg_match($str, '/\(([^)]*)\)/', $matches))
{
$content = $matches[1];
}
A nearly identical question was just asked. There are solutions in there that will work for you ;)