![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php
1697718068
这个作者很懒,什么都没留下…
展开
-
lamp环境下配置虚拟主机
找到HOSTS文件,C:\Windows\System32\drivers\etc,添加:127.0.0.1 www.tp5.com找到httpd-vhosts.conf,wamp\bin\apache\apache2.2.22\conf\extra,添加: ServerAdmin webmaster@dummy-host2.example.com Docume原创 2016-08-20 14:29:33 · 393 阅读 · 0 评论 -
linux部署ThinkPHP
说来惭愧,不只开发了一个小项目了,今天第一次把项目部署到linux上。自己以前都是在windows上面开发系统,对于linux的了解也只局限与大学课本上学到的。下面将今天遇到的问题写成博客,就当是前车之鉴吧。 首先是目录权限问题,ThinkPHP官方的说法是:只需要给Runtime目录读写权限即可,没有必要给网站的根目录777权限,太危险了。我的解决办法是:chmod -R 777 ./Runt原创 2016-08-02 16:23:56 · 568 阅读 · 0 评论 -
ThinkPHP首先判断是否登陆
使用ThinkPHP的前置函数_before_<?phpnamespace Home\Controller;use Think\Controller;class IndexController extends Controller { public function _before_index() { //session('name',null); //测试使用 if(!se原创 2016-07-21 15:26:14 · 765 阅读 · 0 评论 -
PHP由IP地址定位用户所在的城市
使用PHP根据IP地址定位用户所在的城市思路,调用淘宝提供的接口,根据IP地址定位!function addressIP($clientIP) { $getIP = 'http://ip.taobao.com/service/getIpInfo.php?ip='.$clientIP; $IPinfo = json_decode(file_get_contents($getIP));转载 2016-07-13 09:23:30 · 776 阅读 · 0 评论 -
PHP中使用substr()截取字符串出现中文乱码
语法:string substr(string string,int start[,int length]);substr()传回string的一部分字符串,由参数start和length指定<?php$res = substr('abcdefg',1); //bcdef$res = substr('abcdefg',1,3); //bcd$res = subs翻译 2016-07-16 11:46:36 · 267 阅读 · 0 评论 -
ThinkPHP的图片上传
ThinkPHP3.2.2文件上传简单粗暴,直接上代码Controller文件夹下的UploadController.class.php<?phpnamespace Home\Controller;use Think\Controller;class UploadController extends Controller { public function index() {转载 2016-07-21 09:20:56 · 379 阅读 · 0 评论 -
BCMath 任意精度数学
bcadd — 2个任意精度数字的加法计算string bcadd ( string $left_operand , string $right_operand [, int $scale ] )原创 2016-12-09 15:04:51 · 1075 阅读 · 0 评论