Created
January 27, 2019 03:54
-
-
Save imvkmark/a9be050adf86b8fbaed58db69616c7ab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (preg_match("/^data:image\/(?<extension>(?:png|gif|jpg|jpeg));base64,(?<image>.+)$/", $item->user->face_image, $matchings)) { | |
$imageData = base64_decode($matchings['image']); | |
$extension = $matchings['extension']; | |
$filename = sprintf('user-%s.%s', $item->user->id, $extension); | |
$disk->put('face_image/' . $filename, $imageData); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment