I need to find out the width & height from the below string
$embed_code = '<iframe id="streamlike_player" name="streamlike_player" marginwidth="0" marginheight="0" src="http://cdn.streamlike.com/hosting/orange-business/embedPlayer.php?med_id=5bad83b03860eab0&width=600&height=391.235955056&lng=fr" frameborder="0" width="600" scrolling="no" height="391"></iframe>';
I am using below to find out width & height but its not giving me exact result I want
preg_match("/width=\"(.*?)\"/", $embed_code, $w_matches);
preg_match("/height=\"(.*?)\"/", $embed_code, $h_matches);
The result is
Array
(
[0] => width="0"
[1] => 0
)
Array
(
[0] => height="0"
[1] => 0
)
which should be
Array
(
[0] => width="600"
[1] => 600
)
Array
(
[0] => height="391"
[1] => 391
)
Any one have any idea regarding it? Any help will be appreciated.
Thanks in advance.
Umesh Kulkarni