One way of extracting substrings is using one of the regex family functions.
The example below may not be the best implementation, but it should give you an idea...
-
$string = '<object width="425" height="350">';
-
$expr=" width=\"([0-9]+)\" +height=\"([0-9]+)";
-
-
# case insensitive match is good when dealing with HTML tags
-
if (eregi($expr, $string, $regs)) {
-
echo 'width=' . $regs[1] . ' height=' . $regs[2];
-
} else {
-
echo "failed to find a match";
-
}
-
-
You may want to look at other regex functions (preg_match, etc)
http://us2.php.net/manual/en/function.preg-match.php