...

View Full Version : Seperate values



jfreak53
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
<?php

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

?>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum