$xml_string="<?xml version='1.0'?> <moleculedb> <molecule name='Benzin…
使用下面的 PHP 片段可以即时压缩 zip 文件 function create_zip($files = array(),$destination = '',$overwrit…
如果你需要下载特定的文件而不用另开新窗口,下面的代码片段可以帮助你。 function force_download($file) { $dir = "../log/ex…
这个代码片段可以方便你禁止某些特定的 IP 地址访问你的网站 if ( !file_exists('blocked_ips.txt') ) { $deny_ips = array(…
<?php /*给图片加文字水印的方法*/ $dst_path = 'http://xxx.jpg'; $dst = imagecreatefromstring(file_g…
function getRealIpAddr() { if (!emptyempty($_SERVER['HTTP_CLIENT_IP'])) { $ip=$_SERVER['HT…
<?php getValidate(100,30); function getValidate($w,$h){ $img = imagecreate($w,$h); $gra…
有时候,当在网站填写表单,用户可能会输入错误的邮箱地址,这个函数可以验证邮箱地址是否有效。 function is_validemail($email) { $check = 0;…
<?php $pdf_file = './pdf/demo.pdf'; $save_to = './jpg/demo.jpg'; //make sure that apach…
使用下面的函数可以获取任何域名用户的完整细节 function whois_query($domain) { // fix the domain name: $domain = s…
<?php header("Content-type: image/png"); $string = $_GET['text']; $im = image…
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://…
php时间比较函数,返回两个日期相差几秒、几分钟、几小时或几天