随笔分类 - PHP
PHP
摘要:实现对数组按首字符过滤。View Code string(4) "abcd" [1]=> string(5) "abcde" }//End_php另:这段代码发现了一个奇怪的问题:分隔符使用','(逗号)的时候会出现问题。
阅读全文
摘要:jQuery实现百度导航li拖放排列效果,即时更新数据库
阅读全文
摘要:php读取txt文件组成SQL并插入数据库
测试结果:
100000 (10万)行插入:2.5534288883209s
1000000(100万)行插入:19.677318811417s
/**
* $splitChar 字段分隔符
* $file 数据文件文件名
* $table 数据库表名
* $conn 数据库连接
* $fields 数据对应的列名
* $insertType 插入操作类型,包括INSERT,REPLACE
*/
function loadTxtDataIntoDatabase($splitChar,$file,$table,$conn,$fields=array(),$insertType='INSERT'){}
阅读全文
摘要:本程序实现了使用一个index.php文件来实现所有文件夹的遍历效果,避免了需要无穷复制index.php至文件夹下才能实现的效果。以下是核心文件:index.php文件 List Files " type="text/css" /> 'txt文本文...
阅读全文
摘要:/*读取文件内容至字符串中,同时去除换行、行首行尾空格。*/
echo preg_replace('/((\s)*(\n)+(\s)*)/i',',',file_get_contents('./file.php'));
阅读全文
摘要://输出图片imageOutput.php OutPut Image "/>html中图片显示为://处理图片链接getImage_process.php<?php $url = base64_decode ($_GET['id']); echo file_get_c...
阅读全文
摘要:演示地址<?php header("content-type:image/gif"); $str=file_get_contents("example_image.gif"); echo $str;//End_php
阅读全文
摘要:PHP+jQuery 实现二级联动菜单 演示地址
阅读全文
摘要:$url = 'http://www.cnblogs.com/Zjmainstay/archive/2012/03/08/PHP_FUNCTION_file_get_contents.html';
$bad_url = 'http://www.cnblogs.com/Zjmainstay/archive/2012/03/08/PHP_FUNCTION_file_get_contents_bad.html';
ini_set('default_socket_timeout', 3); /*超时控制(3秒)*/
if($data = file_get_contents($bad_url)) {
echo $data;
}else {
echo 'Timeout';
}
if($data = file_get_contents($url)) {
echo $data;
}else {
echo 'Timeout';
}
(全文结束)
阅读全文