79281408

Date: 2024-12-14 21:04:09
Score: 1
Natty:
Report link

The most easiest way is to deal it with the preg_match if it matches the base 64 data url pattern you can easily get image type

`preg_match('/^data:(image\/\w+);base64,/', $dataUrl, $matches)
 $imageType = $matches[1];`

using this regex you will get image type in $imageType

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: shweta mishra