由于csdn速度有限,预留分页吧 1、用PHP打印出前一天的时间,格式是2006-5-10 22:21:21 ? php //echo date('Y-m-d H:i:s',time()-60*60*24 echo date ( Y:m:dH:i:s , strtotime ( -1day )); ? 2、echo(),print(),print_r()的区别 echo是语言结构,无返回值;pr

由于csdn速度有限,预留分页吧

1、用PHP打印出前一天的时间,格式是2006-5-10 22:21:21

转php面试题及我的答案(一)-LMLPHP$j;$i++)
转php面试题及我的答案(一)-LMLPHP {
转php面试题及我的答案(一)-LMLPHP $res=$var[$i].$res;
转php面试题及我的答案(一)-LMLPHP }
转php面试题及我的答案(一)-LMLPHP return $res;
转php面试题及我的答案(一)-LMLPHP}
转php面试题及我的答案(一)-LMLPHP$tmpvar="wofang";
转php面试题及我的答案(一)-LMLPHP$res=reverse($tmpvar);
转php面试题及我的答案(一)-LMLPHPecho $res;
转php面试题及我的答案(一)-LMLPHP?>

7、优化MYSQL数据库的方法。

(1).数据库设计方面,这是DBA和Architect的责任,设计结构良好的数据库,必要的时候,去正规化(英文是这个:denormalize,中文翻译成啥我不知道),允许部分数据冗余,避免JOIN操作,以提高查询效率
(2).系统架构设计方面,表散列,把海量数据散列到几个不同的表里面.快慢表,快表只留最新数据,慢表是历史存档.集群,主服务器Read & write,从服务器read only,或者N台服务器,各机器互为Master
(3).(1)和(2)超越PHP Programmer的要求了,会更好,不会没关系.检查有没有少加索引
(4).写高效的SQL语句,看看有没有写低效的SQL语句,比如生成笛卡尔积的全连接啊,大量的Group By和order by,没有limit等等.必要的时候,把数据库逻辑封装到DBMS端的存储过程里面.缓存查询结果,explain每一个sql语句
(5).所得皆必须,只从数据库取必需的数据,比如查询某篇文章的评论数,select count(*) ... where article_id = ? 就可以了,不要先select * ... where article_id = ?然后msql_num_rows.
只传送必须的SQL语句,比如修改文章的时候,如果用户只修改了标题,那就update ... set title = ? where article_id = ?不要set content = ?(大文本)
(6).必要的时候用不同的存储引擎.比如InnoDB可以减少死锁.HEAP可以提高一个数量级的查询速度

8、谈谈事务处理

A给B的账户转账50美元的例子

9、apache+mysql+php实现最大负载的方法

见7

10.实现中文字串截取无乱码的方法。

mb_substr()

11.

转php面试题及我的答案(一)-LMLPHPphp
转php面试题及我的答案(一)-LMLPHP$empty = '';
转php面试题及我的答案(一)-LMLPHP$null = NULL;
转php面试题及我的答案(一)-LMLPHP$bool = FALSE;
转php面试题及我的答案(一)-LMLPHP$notSet;
转php面试题及我的答案(一)-LMLPHP$array = array();
转php面试题及我的答案(一)-LMLPHP//以下是问题
转php面试题及我的答案(一)-LMLPHP$a = "hello";
转php面试题及我的答案(一)-LMLPHP$b = &$a;
转php面试题及我的答案(一)-LMLPHPunset($b);
转php面试题及我的答案(一)-LMLPHP$b = "world";
转php面试题及我的答案(一)-LMLPHP//答案为:hello
转php面试题及我的答案(一)-LMLPHPecho $a;
转php面试题及我的答案(一)-LMLPHP?>

12.

转php面试题及我的答案(一)-LMLPHPphp
转php面试题及我的答案(一)-LMLPHP$empty = '';
转php面试题及我的答案(一)-LMLPHP$null = NULL;
转php面试题及我的答案(一)-LMLPHP$bool = FALSE;
转php面试题及我的答案(一)-LMLPHP$notSet;
转php面试题及我的答案(一)-LMLPHP$array = array();
转php面试题及我的答案(一)-LMLPHP//以下是问题
转php面试题及我的答案(一)-LMLPHP$a = 1;
转php面试题及我的答案(一)-LMLPHP$x = &$a;
转php面试题及我的答案(一)-LMLPHP$b = $a++;
转php面试题及我的答案(一)-LMLPHP
转php面试题及我的答案(一)-LMLPHP//以下为答案:1
转php面试题及我的答案(一)-LMLPHPecho $b;
转php面试题及我的答案(一)-LMLPHP?>

13

转php面试题及我的答案(一)-LMLPHPphp
转php面试题及我的答案(一)-LMLPHP$empty = '';
转php面试题及我的答案(一)-LMLPHP$null = NULL;
转php面试题及我的答案(一)-LMLPHP$bool = FALSE;
转php面试题及我的答案(一)-LMLPHP$notSet;
转php面试题及我的答案(一)-LMLPHP$array = array();
转php面试题及我的答案(一)-LMLPHP//以下是问题
转php面试题及我的答案(一)-LMLPHP$x = empty($array);
转php面试题及我的答案(一)-LMLPHP
转php面试题及我的答案(一)-LMLPHP//以下为答案:true
转php面试题及我的答案(一)-LMLPHPecho $x?"true":"false";
转php面试题及我的答案(一)-LMLPHP?>

14、用PHP写出显示客户端IP与服务器IP的代码:

转php面试题及我的答案(一)-LMLPHPphp
转php面试题及我的答案(一)-LMLPHP$ip=gethostbyname ("");
转php面试题及我的答案(一)-LMLPHPecho $ip;
转php面试题及我的答案(一)-LMLPHP?>


参考:

1.http://chin.bokee.com/5327971.html

09-18 09:27