Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $img = rawurldecode($_POST['image']);
- $img = str_replace('data:image/png;base64,', '', $img);
- $img = str_replace(' ', '+', $img);
- $data = base64_decode($img);
- $file = "images/" . $rnd . '.png';
- $success = file_put_contents($file, $data);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement