随笔分类 - php
1
摘要:symfony2\app\config\config.yml修改一下 doctrine: dbal: driver: %database_driver% host: %database_host% port: %database_port% dbname: %database_name% ...
阅读全文
摘要:Warning: ZipArchive::getFromName(): Invalid or unitialized Zip object 解决方法 Excel版本问题。解决方法:判断当前版本。 $objReader = PHPExcel_IOFactory::createReader('Excel
阅读全文
摘要:PHPExcel 自己下载。 PHP读取EXCEL PHP导出EXCEL EXCEL转为html
阅读全文
摘要:protected function checkphone(){ if(preg_match("/^1[34578]\d{9}$/", $phone)){ return false; }else{ return true; } }
阅读全文
摘要:php调用webservice的方法try{ $client = new SoapClient("http://127.0.0.1:8888/xx/xx?wsdl"); $param = array('arg0' => 'test','arg1' => $result,'arg2' => null)
阅读全文
摘要:function dirsize($dir){ @$dh = opendir($dir); $size = 0; while($file = @readdir($dh)){ if($file!="." && $file!=".."){ $path...
阅读全文
摘要:query('set names utf8');//设置编码 echo "正在执行导入操作"; while($SQL = GetNextSQL()){ if(!$pdo->query($SQL)){ echo "执行出错"; ec...
阅读全文
摘要:1.找到phpmyadmin目录,新建文件夹import 2.打开import文件夹,将要导入的sql文件放进去 3.打开config.inc.php文件,修改$cfg['UploadDir']等于import,$cfg['UploadDir'] = 'import'; 没有的可自行加上 4.打...
阅读全文
摘要:DocumentRoot "D:\product\web\Public" ServerName demo.web.com DirectoryIndex app.php Options Indexes FollowSymLinks ExecCGI ...
阅读全文
摘要:/** * 判断当前服务器系统 * @return string */ function getOS(){ if(PATH_SEPARATOR==':'){ echo "Linux"; }else{ ...
阅读全文
摘要:1.$pdo = new PDO("mysql:host=localhost;dbname=test","root","123456");//连接数据库2.pdo操作方法 query() 主要是用于有记录结果返回的操作,特别是SELECT操作 exec() 主要是针对没有结果集合返回的操作,如...
阅读全文
摘要:1){ $rand_keys = (array)array_rand($input,$count-1); $last = 0; foreach($rand_keys as $i=>$key){ $current = $input[$key]-$last; $item...
阅读全文
摘要:1.很多时候会遇到二维数组,转为一维数组的时候会很苦恼,尤其是刚刚接触PHP的phper。如下:将$arr转化为一维数组$arr = Array ( Array ( 'uuid' => 'aaaaa' ), Array ( 'uuid' => 'bbbbb' ), Array (...
阅读全文
摘要:1.使用insert into插入 ini_set('max_execution_time','0');//限制超时时间,因为第一种时间较长,索性设为0不限制 $pdo = new PDO("mysql:host=localhost;dbname=oradt_cloud1520","root"...
阅读全文
摘要:1.修改php的配置文件,找到php.ini文件 max_execution_time = 120 ;//设置成你想要的值,单位是秒2.使用ini_set()函数,使用这个函数来改变你的最大执行时间限制值 ini_set('max_execution_time', '100');则设置为100秒...
阅读全文
摘要:function strrand($len) { $arr = array( "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "
阅读全文
摘要:exit(0)与exit(1)、return区别exit(0):正常运行程序并退出程序;exit(1):非正常运行导致退出程序;return():返回函数,若在主函数中,则会退出函数并返回一值。详细说:1. return返回函数值,是关键字; exit 是一个函数。 2. return是语言级别的,...
阅读全文
摘要:整理了就是这几种,,有些在IE下面是不支持的,慎用。。。1,history.go(0)2,location.reload()3,location=location4,location.assign(location)5,document.execCommand('Refresh')6,window....
阅读全文
摘要:1.最近做插入数据库,然后一直报一个错。mysql server has gone away.(如下图)查了好多资料,终于解决了。。1.可能是连接超时。。进入php.ini,修改wait_timeout的值。。有的版本可能没有这两个值,自行添加wait_timeout=28800interactiv...
阅读全文
摘要:打开wamp->apps->phpmyadmin目录下面的config.inc.php文件cfg['Servers'][$i]['verbose'] = 'localhost';$cfg['Servers'][$i]['host'] = 'localhost';$cfg['Servers'][$i]...
阅读全文
1

浙公网安备 33010602011771号