发表时间:2015-05-27来源:网络
今天去了北京著名IT公司进行PHP程序员的面试。这是人生第一次么,怎么不紧张?我是不是有病。不是,这叫自信呵.
首先是做一些笔试题。我的答案是:使用stripos()这个函数来解决的。
if(stripos($a,$b)>-1) echo "b in a";else echo "b not in a";
拓展:
$b_arr = str_split($b);for(var $i=0,$len = count($b_arr); $i < $len ; ++$i){ if(stripos($a,$b_arr[$i])==-1) return false; return true;}
class Timer { private $StartTime = 0;//程序运行开始时间 private $StopTime = 0;//程序运行结束时间 private $TimeSpent = 0;//程序运行花费时间 function start(){//程序运行开始 $this->StartTime = microtime(); } function stop(){//程序运行结束 $this->StopTime = microtime(); } function spent(){//程序运行花费的时间 if ($this->TimeSpent) { return $this->TimeSpent; } else { list($StartMicro, $StartSecond) = explode(" ", $this->StartTime); list($StopMicro, $StopSecond) = explode(" ", $this->StopTime); $start = doubleval($StartMicro) + $StartSecond; $stop = doubleval($StopMicro) + $StopSecond; $this->TimeSpent = $stop - $start; return substr($this->TimeSpent,0,8)."秒";//返回获取到的程序运行时间差 } } } $timer = new Timer(); $timer->start(); //...程序运行的代码 $timer->stop(); echo "程序运行时间为:".$timer->spent();
下面是简单版的。
class Timer{ private $t = 0; public function start(){ $this->t = microtime(true); } public function stop(){ return microtime(true)- $this->t; }}$time = new Timer();$time->start();//do somethings...$t = $time->stop();
create table url( `id` int(11) not null primary key auto_increment comment "主键", `url` varchar(255) not null comment "url 内容", `name` varchar(50) comment "url对应的名称")ENGINE=MyISAM
不是我想简单写啊。这么多题目就一张A4纸啊。
这不是逼着我写简单点吗?不过我还是犯了一些低级的错误。我正在努力改正。
一点福利,分享给大家。
Best Wishes.
上一篇:PHP 使用Apache 中的ab 测试网站的压力性能
下一篇:php抓取网页
CI框架连接数据库配置操作以及多数据库操作
asp 简单读取数据表并列出来 ASP如何快速从数据库读取大量数据
C语言关键字及其解释介绍 C语言32个关键字详解
C语言中sizeof是什么意思 c语言里sizeof怎样用法详解
PHP中的魔术方法 :__construct, __destruct , __call, __callStatic,__get, __set, __isset, __unset , __sleep,
将视频设置为Android手机开机动画的教程
PHP中的(++i)前缀自增 和 (i++)后缀自增
最简单的asp登陆界面代码 asp登陆界面源代码详细介绍
常用dos命令及语法
PHP中include和require区别之我见
桩桩充电官方版下载v2.4.2 安卓版
80.31MB |生活服务
中国天气通专业版最新版下载v9.1.0.4 官方安卓版
56.95MB |系统工具
新疆联通网上营业厅官方版(又名中国联通)下载v12.8 安卓客户端
118.17MB |生活服务
联通手机营业厅关怀版(又名中国联通)下载v12.8 安卓最新版
118.17MB |生活服务
28hse香港租屋网APP下载v3.14.0 手机版
51.07MB |生活服务
唐山联通掌上营业厅(中国联通)下载v12.8 安卓版
118.17MB |生活服务
新货多app下载v2.6.2 安卓最新版
65.91MB |生活服务
东梨短剧免费正版app下载v4.0.3 安卓版
61MB |影音播放
2014-09-05
2022-03-20
2022-03-21
2022-03-24
2014-09-05
2014-09-05
2015-07-05
2014-09-05
2014-09-05
2022-03-21