//变量说明:
// $url 是远程图片的完整url地址,不能为空。
// $filename http://www.phprm.com是可选变量: 如果为空,本地文件名将基于时间和日期
// 自动生成.
ajax+php分页代码
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.phprm.com/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>php中用ajax提交查询的数据没有和数据库教程同步</title>
获取远程服务器网站源文件二种方法
function getsourcecode($q){
return @file_get_contents($q);
}
//用curl获取网站源文件
function c_getpagecode($c_url,$p_i=0){
$user_agent = "mozilla/4.0";
$proxy[0] = "http://211.155.231.208:80"; //浙江省杭州市 电信idc机房
$proxy[1] = "http://210.51.10.197:8888"; //北京市 通泰大厦网通idc机房
$ch = curl_init();
curl_setopt ($ch, curlopt_proxy, $proxy[$p_i]);
curl_setopt ($ch, curlopt_url, $c_url);
curl_setopt ($ch, curlopt_useragent, $user_agent);
//curl_setopt ($ch, curlopt_cookiejar, "c:cookie.txt");
curl_setopt ($ch, curlopt_header, 0);
curl_setopt ($ch, curlopt_returntransfer, 1);
curl_setopt ($ch, curlopt_followlocation, 1);
curl_setopt ($ch, curlopt_timeout, 120);
$result = curl_exec ($ch);
curl_close($ch);
return $result;
}
php域名匹配正则表达式代码
//实例应用
$com = 'www.phprm.com';
php 判断IP是否合法正则表达式代码
function matchip($q){
preg_match('/((25[0-5])|(2[0-4]d)|(1dd)|([1-9]d)|d)(.((25[0-5])|(2[0-4]d)|(1dd)|([1-9]d)|d)){3}/', $q, $matches);
return $matches[0];
}
$ipaddress = '201.103.2.2';
$iperror ='262.3.6.6';
php 调用oracle存储过程代码(1/3)
/*
速度和效率。使用存储过程的速度显然更快。在效率上,如果应用一次需要做一系列sql操作,则需要往返于php与oracle,不如把该应用直接放到数据库教程方以减少往返次数,增加效率。但是在internet应用上,速度是极度重要的,所以很有必要使用存储过程
*/
PHP判断网址是否合法的正则表达式
//一
'/^https教程//?.+.[a-z]{2,4}$/';
几款经典php分页程序(1/4)
function _pageft($totle, $displaypg = 20, http://pic3.phprm.com/2015/07/17/$url.jpg = '') {
global $page, $firstcount, $pagenav, $_server;
经典php分页代码与分页原理(1/3)
1、前言
分页显示是一种非常常见的浏览和显示大量数据的方法,属于web编程中最常处理的事件之一。对于web编程的老手来说,编写这种代码实在是和呼吸一样自然,但是对于初学者来说,常常对这个问题摸不着头绪,因此特地撰写此文对这个问题进行详细的讲解,力求让看完这篇文章的朋友在看完以后对于分页显示的原理和实现方法有所了解。本文适合初学者阅读,所有示例代码均使用php编写。
php导出数据到csv文件
判断某数组当中是否含有某字符或字符串的函数in_array
$arr_2='index/logo.png';
//怎样将$arr_2在$arr_1出现过的图片复制到"images/"目录下?
//有没有判断某数组当中是否含有某子元素的函数?