PHP取整的三个方法
floor()  (舍去小数部分,只取整数) ceil()  (进一取整,只要有小数部分,直接加一) round()  (四舍五入取整)
PHP curl后json_decode无法将json转换成数组
curl返回的数据中带有bom格式,需要转换; 有些返回数据直接: print_r(json_decode($data,true)); 就可以转换。   $url = "http://localhost/web_services.php"; $post_data = array ("username" => "bob","key" …
PHP 发送POST请求
/** * 发送post请求 * @param string $url 请求地址 * @param array $post_data post键值对数据 * @return string */ function send_post($url, $post_data) { $postdata = http_build_query($post_data…
Mysql添加外键
为已经添加好的数据表添加外键: 语法:alter table 表名 add constraint FK_ID foreign key(你的外键字段名) REFERENCES 外表表名(对应的表的主键字段名); 例: alter table tb_active add constraint FK_ID foreign key(user_id) REF…
老版phpstudy默认不支持64位php的解决方法
备忘一下: windows上用phpstudy比较简便,但是其默认的php所有版本都是32位的,有坑,比如int最大值。 所以从php官网 点击打开链接http://windows.php.net/download#php-7.0-nts-VC14-x64 , 下载一个64位的php7丢到phpstudy的php目录下面去(和其他版本一起的那个目录…
CSS3 圆角设置
/* 圆角 */ -moz-border-radius-topleft:15px; -moz-border-radius-topright:15px; -moz-border-radius-bottomright:15px; -moz-border-radius-bottomleft:15px; -webkit-border-top-left-ra…