![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php
yteasyhappy
这个作者很懒,什么都没留下…
展开
-
php 过滤特殊字符函数
1.过滤HTML代码$str= htmlspecialchars_decode($str); $str= preg_replace("//","",$str); 2.htmlspecialchars()函数把一些预定义的字符转换为 HTML 实体。3.strip_tags() 函数剥去字符串中的 HTML、XML 以及 PHP 的标签。4.chop();//除去字符原创 2016-07-19 18:12:42 · 1264 阅读 · 0 评论 -
正则替换图片
#在线咨询$imgsrc = 'images/zxzx.png';$tqStrHtml = htmlspecialchars_decode($data["tq_mobile_code"]);$reg = '//iUs';$str = preg_replace($reg, '在线咨询', $tqStrHtml);转载 2014-11-06 10:57:16 · 395 阅读 · 0 评论 -
文件下载
$file="D:/AppServ/www/a.txt";if(is_file($file)) { header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=".basename($file));转载 2014-11-19 15:44:44 · 202 阅读 · 0 评论 -
滚动加载更多
include("./data/publicedata.php");//include("./data/list_data.php");include("./config/function.php");$listarr = "";$mem = new Memcache;$mem->connect('127.0.0.1',11211);$listarr = unser原创 2014-10-14 09:07:14 · 535 阅读 · 0 评论 -
写数组到文件里面
方法一://将一个测试的数组写入一个PHP文件: //要写入PHP文件的数组 $write_array = array( '1' => 'oneone', '2' => 'two', '3' => 'three', '4' => 'four', '5' => 'five' ); //字符串处理 $string_start = "\n";原创 2014-09-04 14:12:17 · 371 阅读 · 0 评论 -
登陆跳转
if(!isset($_COOKIE['islogin'])){ echo "用户还没登陆,请先登陆"; echo 'setTimeout(\'location="./login1.php"\',3000);'; }原创 2014-08-19 14:36:51 · 269 阅读 · 0 评论 -
把XML转换为数组
$url='http://super.28.com/soap/getprojectwapinfo.php';function getData ($url) { $ch = curl_init($url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTR原创 2014-08-27 10:07:22 · 1842 阅读 · 0 评论 -
p函数
//var_dump($indexarr);function p($indexarr){echo ''; print_r($indexarr); echo ''; } $c=p($indexarr);原创 2014-09-04 14:16:43 · 1104 阅读 · 0 评论 -
php 写日志
$file=fopen("save.txt","a");fwrite($f);原创 2014-06-01 20:56:21 · 346 阅读 · 0 评论 -
ajax json 数组
//添加友情链接 public function addlink() { $sub_subsort = $this->db->getsubsortlist();//三级联动 $arr=array('0'=>array("id"=>"0","sortname"=>"site","sorttruename"=>"首页")); $sub_s原创 2014-11-06 11:09:01 · 212 阅读 · 0 评论 -
上一篇下一篇
$id = get_the_ID();$category = get_the_category($id);$Single = get_post($id);$data = get_posts("category=".$category[0]->term_id."&numberposts=1000");$PID = "";$PLink = "";$NID = "";$N原创 2015-01-27 11:52:00 · 579 阅读 · 0 评论 -
host
DocumentRoot D:/taiji ErrorLog D:/taiji/logs/err_log CustomLog D:/taiji/logs/access_log combined ServerName wordpresss.com Options FollowSymLinks AllowOverride Non转载 2015-01-28 18:31:13 · 209 阅读 · 0 评论 -
课程链接
http://www.ydma.cn/course/59翻译 2015-12-15 17:43:01 · 552 阅读 · 0 评论 -
获取IP地区
/** * 获取IP地区 * Enter description here ... * @param unknown_type $ip */ function GetArea($ip){ $url = "http://ip168.com/ip/?ip=".$ip; $contents = file_get_contents($url);//原创 2015-04-17 16:10:21 · 221 阅读 · 0 评论 -
读取文件夹里面的文件名代码
$DataFilePath = "data/";$tools = new FunctionTools();$DataFile = $tools->getFile($DataFilePath); function getFile($dir) { $fileArray[]=NULL; if (false != ($handle = opendi原创 2015-03-13 15:38:02 · 372 阅读 · 0 评论 -
数组写到excel保存
$myfile = fopen($_SERVER["DOCUMENT_ROOT"]."email/files/".$prefix."_".$date.".csv", "w+"); fwrite($myfile, "userid,姓名,打卡时间,异常原因\r\n"); foreach($excelData as $k => $v){ $t原创 2015-03-17 13:55:00 · 579 阅读 · 0 评论 -
phpmailer
include("./lib/sendemail.class.php"); $mail = new PHPMailer; $address = "**********@sina.com"; $mail->IsSMTP(); // 使用SMTP方式发送 //$mail->Host = "smtp.1原创 2015-03-09 14:21:26 · 223 阅读 · 0 评论 -
php 分页
if(isset($_GET['page'])&&($_GET['page']!=0)) $page = $_GET['page'];else $page = 1;$pagesize = 2;$cat_ID = get_query_var('cat');$count = wt_get_category_count($cat_ID); $p原创 2015-01-23 09:38:57 · 261 阅读 · 0 评论 -
虚拟机配置
DocumentRoot D:/AppServ/www/yii/userSystem/userSystem ErrorLog D:/AppServ/www/yii/userSystem/userSystem/logs/err_log CustomLog D:/AppServ/www/yii/userSystem/userSystem/logs/access_log combin原创 2014-12-10 17:33:48 · 364 阅读 · 0 评论 -
php 100个常用函数
http://www.php100.com/html/it/focus/2014/1208/8004.html转载 2014-12-08 18:05:05 · 306 阅读 · 0 评论 -
函 数
1.array_values() 函数返回一个包含给定数组中所有键值的数组,但不保留键名。原创 2014-06-03 08:40:30 · 415 阅读 · 0 评论 -
截取字符串长度 不算html代码的长度
function blog_summary($body, $size, $format = NULL){ $_size = mb_strlen($body, 'utf-8'); if($_size // 输入格式中有 PHP 过滤器// if(!isset($format) && filter_is_php($format)){转载 2014-05-30 16:30:20 · 1822 阅读 · 0 评论 -
js 修改页面样式
window.onload = function () { // alert(config.seat); var footer_float_400_fore2 = document.getElementById('footer_float_400_fore2'); var footer_float_400_flbar_w = document.getElementById('footer原创 2014-06-10 11:47:54 · 458 阅读 · 0 评论 -
表单验证2
翻译 2014-06-09 10:51:35 · 242 阅读 · 0 评论 -
表单验证1
翻译 2014-06-09 10:46:05 · 200 阅读 · 0 评论 -
表单验证3
翻译 2014-06-09 10:58:28 · 313 阅读 · 0 评论 -
管理员增删改
转载 2014-06-06 10:40:55 · 813 阅读 · 0 评论 -
防止sql注入函数
数字的用 $val=intval($val)字符串用 $val=htmlspecialchars($val);入库前 用$val=mysql_escape_string($val)原创 2014-05-23 09:27:39 · 279 阅读 · 0 评论 -
管理员增删改2
转载 2014-06-06 10:50:42 · 726 阅读 · 0 评论 -
管理员操作1
翻译 2014-06-05 11:18:43 · 763 阅读 · 0 评论 -
导航js
翻译 2014-06-09 08:59:22 · 285 阅读 · 0 评论 -
session登陆判断
转载 2014-06-10 09:19:57 · 356 阅读 · 0 评论 -
页面输出和入库过滤
翻译 2014-06-10 16:18:12 · 187 阅读 · 0 评论 -
php抓取图片
//jb51.net/article/22723.htm转载 2014-05-30 16:15:34 · 420 阅读 · 0 评论 -
抓取图片
//URL是远程的完整图片地址,不能为空, $filename 是另存为的图片名字 //默认把图片放在以此脚本相同的目录里 function GrabImage($url, $filename=""){ //$url 为空则返回 false; if($url == ""){return false;} $ext = strrchr($url, ".");//得到图片的扩展名转载 2014-05-30 16:18:26 · 457 阅读 · 0 评论 -
文件上传类 2
翻译 2014-06-12 16:31:34 · 186 阅读 · 0 评论 -
文件上传类
翻译 2014-06-12 16:26:11 · 250 阅读 · 0 评论 -
图片上传
翻译 2014-06-13 09:37:08 · 240 阅读 · 0 评论 -
页面序号和返回上一页
翻译 2014-06-11 08:50:31 · 385 阅读 · 0 评论 -
导航排序1
翻译 2014-06-11 15:02:40 · 285 阅读 · 0 评论