php 948

#PHP
PHP 检测手机浏览器的代码

<?php function is_mobile(){ // returns true if one of the specified mobile browsers is …

2015-08-13 885

#PHP
一个简单的 PHP 访问计数器

<? // start at the top of the page since we start a session session_name('mysite_hit_co…

2015-08-13 512

#PHP
PHP提取任意图片的主颜色

function dominant_color($image) { $i = imagecreatefromjpeg($image); for ($x=0;$x<images…

2015-08-09 746

#PHP
PHP获取远程文件的大小

function remote_filesize($url, $user = "", $pw = "") { ob_start(); $ch…

2015-08-09 478

#PHP
可以获取任意 Web 页面HTML 代码的PHP函数

function display_sourcecode($url) { $lines = file($url); $output = ""; foreach (…

2015-08-09 261

#PHP
PHP限制文件下载的速度

<?php // local file that should be send to the client $local_file = 'test-file.zip'; //…

2015-08-09 524

#PHP
从 PHP 数据创建 CSV 文件

function generateCsv($data, $delimiter = ',', $enclosure = '"') { $handle = fopen('ph…

2015-08-09 177

#PHP
使用IP判断访问用户是在哪个城市的PHP代码

function detect_city($ip) { $default = 'UNKNOWN'; $curlopt_useragent = 'Mozilla/5.0 (Windo…

2015-08-09 946

#PHP
PHP计算两个经纬度之间的距离

function getDistanceBetweenPointsNew($latitude1, $longitude1, $latitude2, $longitude2) { $…

2015-08-09 692

#PHP
读取 CSV 文件的PHP代码

function readCSV($csvFile){ $file_handle = fopen($csvFile, 'r'); while (!feof($file_handle…

2015-08-09 846

#PHP
防止SQL注入的PHP 函数

SQL 注入或者 SQLi 常见的攻击网站的手段,使用下面的代码可以帮助你防止SQL注入 function clean($input) { if (is_array($input)…

2015-08-09 315

#PHP
PHP生成二维码

function qr_code($data, $type = "TXT", $size ='150', $ec='L', $margin='0') { $ty…

2015-08-09 391
1 21 22 23 24 25 79