![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PHP
春风又一季
lecodeyang.github.io/yangmimi
展开
-
PHP变量中字符串拼接
我们知道js的拼接是+号连接的,数字相加的话先把数字转化为int型,因为js默认的是string类型 <?php //定义字符串 $str1 = "Hello World!"; $str2 = "Welcome to bei jing!"; //连接上面两个字符串 中间用空格分隔 $str3 = $str1 . " " . $str2; //输出连接后的字符串...转载 2019-05-19 20:31:47 · 5690 阅读 · 0 评论 -
Python关于字符串的一些操作
python的字符串的长度python 字符串长度通过内置方法len()来计算字符串的长度,注意这个计算的是字符的长度。aa = 'afebb'bb = '你'print len(aa)print len(bb)python字符串的替换a = 'hello word'b = a.replace('word','python')print b如何使用python语言中的字...原创 2019-05-29 21:29:21 · 132 阅读 · 0 评论 -
如何判断PHP数组是否为空
PHP判断数组为空首选方法:count($arr),size($arr);$arr= array("");echo count($arr);echo size($arr);//输出1$arr= array();echo count($arr);echo size($arr);//输出0PHP判断数组为空方法2:empty($arr);$arr= array("");$r...转载 2019-06-01 22:28:51 · 2290 阅读 · 0 评论 -
mysql_query()返回的类型or结果集
mysql_query()如果里面放的是查询之类的语句,那返回的是资源,说白了就是你要查的数据结果集;如果里面放的是增删改之类的语句,那返回的是true或者false了。如果你要使用这个数据结果集,必须用mysql_result(), mysql_fetch_array(), mysql_fetch_row()等函数获取里面的数据,就是mysql_query()得和上面几个函数配合使用。但...转载 2019-05-28 17:37:08 · 8621 阅读 · 0 评论 -
php的curl与json_encode与get_object_vars与自定义函数与& amp和&与file_get_contents
<?phpfunction geturl($url){ $headerArray =array("Content-type:application/json;","Accept:application/json"); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); ...原创 2019-05-25 21:02:44 · 268 阅读 · 0 评论 -
在 Ubuntu 16.04上安装 Nginx, MySQL, PHP (LEMP)
完全卸载apache2sudo apt updatesudo apt upgradesudo apt remove apache2*sudo apt autoremove安装Nginxsudo apt install nginxsudo service nginx st...转载 2019-05-15 17:10:04 · 164 阅读 · 0 评论 -
php获取的不是国内的时间
设置时区为中国的时区date_default_timezone_set('PRC');date("Y/m/d") date("H:i:s")原创 2019-05-20 11:38:33 · 106 阅读 · 0 评论 -
关于php传到数据库中文乱码出现?的问题
首先看图前面是错误的,后面改好了1.在php的编码中修改字符集header("Content-Type: text/html; charset=utf-8"); //一个地方$operation = $_POST['operation'];$link = @mysql_connect("localhost", "root", "root") or die("提示:数据库连接失败!");...原创 2019-05-20 09:48:18 · 1412 阅读 · 0 评论 -
phpstudy安装mongodb扩展
https://jingyan.baidu.com/article/22a299b5eb78839e19376ad7.html转载 2019-07-09 12:00:01 · 313 阅读 · 0 评论