2016年12月7日

摘要: 创建线上数据库 将项目上传到空间FTP 通过域名访问项目时,如果遇到以下问题: 是因为线上PHP版本太低,需要升级PHP版本。 这是因为入口文件index.php会对PHP版本进行检测 这时就要升级线上的PHP版本:以景安为例: 修改PHP版本之后,可以通过URL进行访问 注意:1、项目上线后要更改 阅读全文
posted @ 2016-12-07 20:35 PHP博客园 阅读(497) 评论(0) 推荐(0)
摘要: 流程: wx_sample.php 阅读全文
posted @ 2016-12-07 16:27 PHP博客园 阅读(195) 评论(0) 推荐(0)
摘要: AJAX包括$.ajax $.post $.get $.getJSON $.get和$.post唯一区别是后台接收数据的方式不同。 $.each是jQuery中的循环数组方发,必须引用过jQuery后才可使用。 $.each(result,function(){}); AJAX是Async(异步) 阅读全文
posted @ 2016-12-07 16:21 PHP博客园 阅读(162) 评论(0) 推荐(0)
摘要: 字符串操作: str.php trim(); //默认去除首尾空白字符,如果要指定去除的字符(第二个参数),则空格不会去除 ltrim(); rtrim(); ucfirst(); //字符串首字母换成大写,uppercase ucwords(); //单词首字母换成大写 strtolower(); 阅读全文
posted @ 2016-12-07 15:43 PHP博客园 阅读(151) 评论(0) 推荐(0)
摘要: js数组:array.html <script type="text/javascript"> 设置script typeof 判断表达式的类型并返回、 arr.length js中获取数组长度是通过.length属性,PHP中是通过count($arr)获取 arr[arr.length]="fo 阅读全文
posted @ 2016-12-07 14:59 PHP博客园 阅读(366) 评论(0) 推荐(0)

2016年12月6日

摘要: URL函数: base64_encode(); //把字符串转换为64位,不可观的编码,加密 base64_decode(); //把字符串转换为可观的字符 urlencode(); //对URL字符串进行编码,把空格转换为加号 urldecode(); //对URL字符串进行解码,把空格转换为%2 阅读全文
posted @ 2016-12-06 21:17 PHP博客园 阅读(463) 评论(0) 推荐(0)
摘要: 什么时候会用到模拟请求:想要得到别人网站上的一些内容,比如获取图片,把一个图片的地址写进去就行了 $ch=curl_init(); //初始化句柄 curl_setopt($ch,CURLOPT_URL,"http://localhost/first_php/d/CURL/get_postdata. 阅读全文
posted @ 2016-12-06 20:57 PHP博客园 阅读(148) 评论(0) 推荐(0)
摘要: Mysql的连接方式: 1.原生函数:mysql_connect($server,$username,$password); //打开一个到Mysql服务器的连接 mysql_select_db($dbname); //选择Mysql数据库 mysql_query(); //发送一条mysql查询 阅读全文
posted @ 2016-12-06 19:00 PHP博客园 阅读(423) 评论(0) 推荐(0)
摘要: 时间函数: date();和time();的相互转换 time(); 在PHP中单位是秒,在js中是毫秒。 microtime(); 毫秒 date('Y-m-d H:i:s',time()); 把时间戳转换为日期格式 strtotime(date()); 把日期格式转换为时间戳 getdate() 阅读全文
posted @ 2016-12-06 17:26 PHP博客园 阅读(486) 评论(0) 推荐(0)
摘要: 文件上传——前台:form.html 文件上传方法: multipart/form-data 上传图片编码格式 enctype=编码格式 iconv(UTF-8,GBK,$name); 编码格式转换 后台通过$_FILES接收文件。 tmp_name 临时文件名,上传文件是系统自动生成 header 阅读全文
posted @ 2016-12-06 14:37 PHP博客园 阅读(258) 评论(0) 推荐(0)

导航