随笔分类 -  PHP

php函数,php技巧
摘要:http://php.net/manual/en/function.strtr.php "-", "hello" => "hi", "hi" => "hello");echo strtr("hi all, I said hello", $trans);?>The above example will... 阅读全文
posted @ 2014-10-08 15:45 KoMiles 阅读(459) 评论(0) 推荐(0) 编辑
摘要:转自:http://blog.csdn.net/wang02011/article/details/8205903环境: wampserver-2.1a系统 : win8错误 : 500 -Invalid command RewriteEngine日志 : [Tue Nov 20 22:52:24 ... 阅读全文
posted @ 2014-09-21 22:35 KoMiles 阅读(731) 评论(0) 推荐(0) 编辑
摘要:转自:http://www.htmer.com/article/716.htm最近在PHP官网上看到又有新版的PHP下载了,于是上去找找For Windows的版本,可是一看确傻眼了,一共给了四个版本,VC9 x86 Non Thread Safe、VC9 x86 Thread Safe、VC6 x... 阅读全文
posted @ 2014-09-21 19:39 KoMiles 阅读(346) 评论(0) 推荐(0) 编辑
摘要:1,找到php.ini配置find / -name 'php.ini'/usr/local/php/etc/php.ini找到extension=php_curl.dll 把前面的分号去掉即可。2,重启phpphp 5.3.3 下的php-fpm 不再支持 php-fpm 以前具有的 /usr/l... 阅读全文
posted @ 2014-09-02 23:03 KoMiles 阅读(5286) 评论(0) 推荐(0) 编辑
摘要:array_flip() 函数返回一个反转后的数组,如果同一值出现了多次,则最后一个键名将作为它的值,所有其他的键名都将丢失。如果原数组中的值的数据类型不是字符串或整数,函数将报错。Return Values¶Returns the flipped array on success andNULLo... 阅读全文
posted @ 2014-06-27 14:19 KoMiles 阅读(4919) 评论(0) 推荐(0) 编辑
摘要:转自:http://cn2.php.net/manual/zh/function.array-chunk.php(PHP 4 >= 4.2.0, PHP 5)array_chunk—将一个数组分割成多个说明arrayarray_chunk(array$input,int$size[,bool$pre... 阅读全文
posted @ 2014-06-25 14:08 KoMiles 阅读(6887) 评论(0) 推荐(0) 编辑
摘要:1,curl -d "userType=seller&userId=1034285" "www.baidu.com/getInfo.php"curl-d"leaderboard_id=7778a8143f111272&score=19&app_key=8d49f16fe034b98b&_test_u... 阅读全文
posted @ 2014-06-16 16:20 KoMiles 阅读(16105) 评论(0) 推荐(1) 编辑
摘要:在查看项目代码时,发现smart代码中有这样写。{if $auctionInfo.printingNum} 印数:{math equation="cid/1000" cid=$auctionInfo.printingNum format="%d"}千册{/if}意思是:把$auctionInf... 阅读全文
posted @ 2014-04-17 17:31 KoMiles 阅读(2843) 评论(0) 推荐(0) 编辑
摘要:http://www.hlbaozhuangji.cn/manage/content/other_info.php?anyid=31&lang=cn首页内容简介:select * from met_config where name = 'met_index_content' \G ;联系方式内容:select * from met_otherinfo \G; 阅读全文
posted @ 2014-04-08 22:45 KoMiles 阅读(281) 评论(0) 推荐(0) 编辑
摘要:原文地址:http://www.phpvar.com/archives/2316.html网上找到一篇介绍WordPress的have_posts()和the_post()用法解析的文章,觉得不错!在WordPress的index.php文章循环输出中,通常会有下面一段代码: 这里有两个函数,have_posts()和the_post()。have_posts()解析:WordPress的have_posts() 默认是一个全局函数。have_posts函数被调用时实际上是调用全局变量$wp_query->have_posts()成员函数,来简单检查一个全... 阅读全文
posted @ 2014-02-16 13:54 KoMiles 阅读(17567) 评论(0) 推荐(0) 编辑
摘要:在ubuntu下面安装了一个wordpress程序,在后台什么都没干,编辑主题时,发现页面中报下面的错误。notice: /home/wwwroot/test.localhost/wordpress/wp-content/themes is not readable in /home/wwwroot/test.localhost/wordpress/wp-includes/theme.php on line 447 Warning: scandir() has been disabled for security reasons in /home/wwwroot/test.localhost/ 阅读全文
posted @ 2014-02-09 00:07 KoMiles 阅读(33011) 评论(0) 推荐(0) 编辑
摘要:昨天重新安装了系统,今天想装一个wamp,在安装过程中报httpd.exe无法找到组件如图u运行wamp,发现图标是黄色的,apache没有选中,测试80端口也未被占用。重新卸载了,又安装了一遍还是不行。到网上搜索了一番,发现这样解决。按照自己的系统,下载下面的文件,安装后,重新安装一遍wamp就可以了。ATTENTION :Vous devez avoir installé Visual C++ 2010 SP1 Redistributable Package x86 ou x64VC10 SP1 vcredist_x86.exe 32 bits :http://www.micro 阅读全文
posted @ 2014-01-08 22:44 KoMiles 阅读(9587) 评论(4) 推荐(0) 编辑
摘要:DedeCMS Error: (PHP 5.3 and above) Please set 'request_order' ini value to include C,G and P (recommended: 'CGP') in php.ini,more...点击more后,链接到http://help.dedecms.com/install-use/apply/2013/0715/2325.html部分使用PHP 5.3的主机可能会有下面的提示:(PHP 5.3 and above) Please set 'request_order' i 阅读全文
posted @ 2013-10-13 19:18 KoMiles 阅读(302) 评论(0) 推荐(0) 编辑
摘要:如果一个文本文件里面的数据比较多,有几万条数据,想把不是邮箱的该过滤掉,该怎么处理?以下是filterUserEmail.php文件的源码 阅读全文
posted @ 2013-09-17 16:23 KoMiles 阅读(359) 评论(0) 推荐(0) 编辑
摘要:一 、解析路径:1 获得文件名:basename();给出一个包含有指向一个文件的全路径的字符串,本函数返回基本的文件名。如果文件名是以 suffix 结束的,那这一部分也会被去掉。eg:$path="/home/httpd/html/index.php";$file=basename($path,".php");//$fileissetto"index"2 得到目录部分:dirname();给出一个包含有指向一个文件的全路径的字符串,本函数返回去掉文件名后的目录名。eg:$path="/etc/passwd";$ 阅读全文
posted @ 2013-08-02 09:53 KoMiles 阅读(6330) 评论(0) 推荐(1) 编辑
摘要:PHP Array 函数定义和用法array_intersect() 函数返回两个或多个数组的交集数组。结果数组包含了所有在被比较数组中,也同时出现在所有其他参数数组中的值,键名保留不变。注释:仅有值用于比较。语法array_intersect(array1,array2,array3...)参数描述array1必需。与其他数组进行比较的第一个数组。array2必需。与第一个数组进行比较的数组。array3可选。与第一个数组进行比较的数组。可以有多个。例子"Cat",1=>"Dog",2=>"Horse");$a2=arr 阅读全文
posted @ 2013-07-31 10:44 KoMiles 阅读(391) 评论(0) 推荐(0) 编辑
摘要:刚安装完dedecms,兴致冲冲的准备进后台,输入完用户名和密码后,页面 中显示一片空白。立马到网上搜搜,发现大家各抒己见,但是都没有解决问题。不过,下面的这个方法是可以的。马上记录下来,以备其他人遇到类似的问题做参考。找include/userlogin.class.php里面的 keepuser()函数,把@session_register($this->keepUserIDTag);注释掉,然后改为if(!isset($_SESSION[$this->keepUserIDTag]))全部有6个。如下:if(!isset($_SESSION[$this->keepUser 阅读全文
posted @ 2013-07-04 23:58 KoMiles 阅读(868) 评论(0) 推荐(0) 编辑
摘要:把一个一维数组转换为in()形式。function dbCreateIn($itemList){ if(empty($itemList )){ return " IN ('') "; }else{ return " IN ('" . join ("','", $itemList) . "') "; }} 阅读全文
posted @ 2013-06-18 15:36 KoMiles 阅读(666) 评论(0) 推荐(0) 编辑
摘要:定义和用法realpath() 函数返回绝对路径。该函数删除所有符号连接(比如 '/./', '/../' 以及多余的 '/'),返回绝对路径名。若失败,则返回 false。比如说文件不存在的话。 阅读全文
posted @ 2013-05-14 12:11 KoMiles 阅读(2608) 评论(0) 推荐(0) 编辑
摘要:有时间再看,先把网址记下来1,Firfox竟然无法获取form对象http://blog.csdn.net/tenfyguo/article/details/53928522,document.forms 的用法http://862123204-qq-com.iteye.com/blog/15553673,SQLyog快捷键大全http://blog.sina.com.cn/s/blog_69516b7f010136nn.html4,svn注意事项http://www.blogjava.net/sealyu/archive/2009/09/03/293717.html5,本地wamp下htac 阅读全文
posted @ 2013-04-09 18:03 KoMiles 阅读(276) 评论(0) 推荐(0) 编辑