0

I have an a string like this

$size = "facebook_page [600x315]";

I want to extract

600x315

I tried this

 preg_match('~[(.*?)]~', $size, $output);
 print_r($output[1]);

It doesn't give me any output. Where am I going wrong? If there's another method it'd help a lot.

Red Bottle
  • 2,313
  • 4
  • 13
  • 40

0 Answers0