面试时间:2018 年 9 月 13 日,星期五,下午 13 : 00。
存在两个时间,如何计算两个日期的天数差。
<?php
$dateStart = '2017-05-03 12:34:56';
$dateEnd = '2020-12-12 09:17:18';
// 计算两个时间天数差
return intval((strtotime($dateEnd) - strtotime($dateStart)) / (24 * 60 * 60));
PHP 中传值和引用的区别是什么?叙述下其应用场景和优劣。
http://php.net/manual/zh/language.references.php
请写一个正则表达式,用来验证手机号码的正确性。
\d{11}
请列举出常用的PHP魔术方法,并说明其应用场景。
http://php.net/manual/zh/language.oop5.magic.php
请写出 echo,print,printf,sprintf,print_r,var_dump 的差异。
http://php.net/manual/en/ref.strings.php
请无乱码的切割中文字符(实例字符:“布克大学,就要不凡”,截取“布克大学”)。
mb_substr("布克大学,就要不凡", 0, 4)
substr("布克大学,就要不凡", 0, 12)
PHP 中异常处理时(try catch finally),return 应该写在哪里?
都可以。
有如下三张表,请写出查询每个学生平均分数的 SQL 语句。
>>> 学生表/students:
id
name # 学生姓名
>>> 成绩表/scores:
id
student_id # 学生id@students.id
subject_id # 科目id@subjects.id
score # 分数
>>> 科目表/subjects:
id
name # 科目名称
结果要求输出 学生姓名 科目名称 平均分数
select students.name as student_name, subjects.name as subject_name, sum(scores.score)/count(students.id) as avg_score
from scores
join students on (students.id = scores.student_id)
join subjects on (subjects.id = scores.subject_id)
group by students.id
PHP 中创建多进程、多线程的方式有哪些,使用多线程、多进程有哪些优缺点。
多进程:
http://php.net/manual/zh/book.pcntl.php
多线程:
http://php.net/manual/en/book.pthreads.php
描述下 IoC 和 DI 的实现原理。
https://phptherightway.com/#dependency_injection
OAuth2 的工作原理是怎么样的?
https://laravel.com/docs/master/passport
(口述作答)根据你的经验,如何规划一个大流量、高并发的WEB站点。
http://network.51cto.com/art/201809/583103.htm
聊聊 MySQL 主从同步。
https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-in-mysql
聊聊 RESTful API 设计。
https://www.toptal.com/laravel/restful-laravel-api-tutorial
如果团队有一个消极的人怎么处理。如果团队成员玩手机被老板发现了怎么处理。能否带领一个 3 到 5 人的团队完成开发任务。
不处理。
543 total views, 1 views today