$value): $array[secure_user_vars($key)] = secure_user_vars($value); endforeach; return $array; }else{ return htmlspecialchars($var, ENT_NOQUOTES, "UTF-8"); } } function base64_to_image($base64_string, $output_file) { $ifp = fopen($output_file, "wb"); $data = explode(',', $base64_string); fwrite($ifp, base64_decode($data[1])); fclose($ifp); return $output_file; } function getExt($file){ $ext = explode('.',$file); return strtolower(array_pop($ext)); } function imageResize($image,$w,$h){ $resource = imagecreatefromstring(file_get_contents($image)); $size = getimagesize($image); $h = (($size[1] * (($w)/$size[0]))); $thumbnail = imagecreatetruecolor($w , $h); imagecopyresampled($thumbnail ,$resource, 0,0, 0,0, $w, $h, $size[0],$size[1]); imagedestroy($resource); imagejpeg($thumbnail , $image, 100); } ?>