Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $img = str_replace(array('data:image/png;base64','data:image/jpeg;base64','data:image/jpg;base64','data:image/gif;base64'), null, $img);
- $img = base64_decode($img);
- $imgurl = 'image_' . substr(md5($img), 0, 24) . mt_rand(0, 100000) . $type;
- create_dir_functions($dir);
- $dir[2] = $dir[1] . '/' . $imgurl;
- file_put_contents( $cdir . $dir[2], $img);
- return $dir[2];
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement