width: 287.942px; height: 162px;
preg_replace('/[^\d.]/', '', 'width: 287.942px; height: 162px;');
preg_match('#width:\s*(\d+(?:\.\d+)?)px.*?height:\s*(\d+(?:\.\d+)?)px#is', $str, $match)
$match = [
'0' => 'width: 287.942px; height: 162px;',
'1' => '287.942',
'2' => '162',
];
preg_match('#width:\s*(\d+(?:\.\d+)?)px#is', $str, $match)
preg_match('#height:\s*(\d+(?:\.\d+)?)px#is', $str, $match)