<?php if ( !isset($_REQUEST["url"]) ) exit; $u = $_REQUEST["url"]; …
<?php define( 'NL', "\n" ); define( 'TB', ' ' ); // connecting to MySQL. $con…
function resize_image($filename, $tmpname, $xmax, $ymax) { $ext = explode(".", $…
$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…