Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function saveImg($base64_img=''){
- $newimg = base64_decode($base64_img);
- $im = imagecreatefromstring($newimg);
- $nameimg = uniqid(). '.jpg';
- $file = realpath('../file_bukti')."/" . $nameimg ;
- if ($im !== false) {
- imagejpeg($im,$file,65);
- imagedestroy($im);
- }
- return array('img_name'=>$nameimg,'img_path'=>$file);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement