![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
面试题
文章平均质量分 60
SevenWG
这个作者很懒,什么都没留下…
展开
-
PHP-浮点数操作
<?php $f = 3.14159; //使用sprintf对浮点数小数点后三位四舍五入 $f_new = sprintf("%.3f",$f); echo "3.14159小数点后三位四舍五入:".$f_new."<br></br><br></br>"; $f_round = round($f,3); ec原创 2018-03-23 19:57:26 · 849 阅读 · 0 评论 -
PHP:time(),strtotime(),date()函数
<?php //设置时区 date_default_timezone_set('Asia/Shanghai'); //返回当前时间的 Unix 时间戳。 $time_now = time(); $time_now2 = date("Y-m-d H:m:s",$time_now); echo "现在时间的时间戳:".$time_now."<br></br&g...原创 2018-03-23 20:29:51 · 1212 阅读 · 0 评论 -
PHP面试题-字符串处理
<?php /*题目要求:输入格式为"get-element-by-id"的任意字符串,将其转换为驼峰命名的字符串,例如getElementById*/ $str = "get-element-by-id"; $str1 = "president-donald-trump"; $str2 = "high-school-student-informantion-management...原创 2018-03-23 20:48:28 · 1103 阅读 · 1 评论 -
PHP-$_SERVER超全局变量
<?php /*返回当前运行脚本所在的服务器的 IP 地址。*/ echo $_SERVER['SERVER_ADDR']."<br>"; /*返回当前运行脚本所在的服务器的主机名*/ echo $_SERVER['SERVER_NAME']."<br>"; /*返回Web 服务器使用的端口。默认值为 “80”。*/ echo $_SERVER['SE...原创 2018-03-23 21:24:29 · 291 阅读 · 0 评论 -
PHP 常用数组函数
<?php $arr = array("123hhh","hahaha","Hello World",123); var_dump($arr); /*in_array() 函数搜索数组中是否存在指定的值。*/ echo "Hello World是否存在于数组arr中:".in_array("Hello World", $arr)."<br>&quo原创 2018-03-24 22:33:08 · 241 阅读 · 0 评论