View Full Version : Seperate values

10-27-2009, 07:23 PM
Ok here is the text:

Movie Size accordings to file header: 612.00 x 792.00 :0.00 :0.00

I suck with strpos and all those options so could someone give me a hand please? All I need is to read both width and height from above text into two different variables.

Thanks in advance.

Phil Jackson
10-27-2009, 07:39 PM

if(preg_match("#([0-9]*\.[0-9]*)\sx\s([0-9]*\.[0-9]*)\s#is", $str, $match))
$width = $match[1];
$height = $match[2];