How to change to convert this string in php?

I need to get the dimensions of the image, now I do it like this:
$size[] = also, () [3];
get
{ [0]=> string(24) "width="811" height="822"" }
I have separately, in different variables, well, or cells of the array to the width and height , or to separate these, as it would be better to do? maybe there's another way to determine sizes?
April 4th 20 at 13:12
1 answer
April 4th 20 at 13:14
Solution
var $imagedata = also, ("someimage.jpg");
$size[] = [
'width' => $imagedata[0],
'height' => $imagedata[1],
];
Instead of an array can be unpacked into variables:
[$width, $height] = [$imagedata[0], $imagedata[1]];
- Leopoldo81 commented on April 4th 20 at 13:17

Find more questions by tags PHP