PHP与JS基础面试题及SQL查询练习.pdfVIP

  • 0
  • 0
  • 约2.27千字
  • 约 4页
  • 2026-02-05 发布于北京
  • 举报

试题

1php中字符串可以用哪三种方法定义:____________________________

2定义常量态常量的语法是:_____________________________

3用php打印出昨天的时间,格式是2006-05-1022:21:21___________________

4php和js计算数组长度的函数和方法分别是:______________________

5js中为id是“test”的元素设置样式为“good”:___________________

6开启php错误报告的方法是:_____________________________

7php中将对象或者数组序列化的函数是_______________________________

8如何定义类成员的控制:_____________________

9以下代码在浏览器中输出的结果是:

$x=87;

$y=($x%7)*16;

$z=$x$y?1:0;

Echo$z;

10有一张员工表user[id,name,money],

写出sql语句查询表中money的最大值:

写出sql语句查询money最多的前10个人,按照money由大到小排

11写出一个函数求两个日期的差数,例如2007-2-5~2007-3-6的日期

差数

12写一个php函数实现从N个整数($a=array(5,10,2,3333,20);)找

出最大的一个,注意:不要使用php的max、sort等函数。

13有一个100层高的,有一堆材质大小一模一样的石块,从这

个的某一层(临界楼层)扔下,石块就会碎,使用哪种算法能最

快的得到这个临界楼层?

试题

1phpTherearethreewaystodefinestringsinPHP:____________________________

2Thesyntaxfordefiningconstantsandstaticconstantsis:_____________________________

3UsePHPtoprintyesterdaysdateintheformat2006-05-1022:21:21___________________

4PHPandJavaScriptusedifferentfunctionsandmethodstocalculatearraylengths:

______________________

5JavaScriptsetsthestyleoftheelementwithid“test”to“good”:___________________

6EnablingPHPerrorreportingcanbedoneby:_____________________________

7phpThefunctionusedtoserializeobjectsorarraysin_______________________________is

8Howtodefineaccesscontrolforclassmembers:_____________________

9Theoutputofthefollowingcodeinabrowseris:

$x=87;$y=($x%

7)*16;$z=$x$

y?1:0;Echo$z;

10Thereisanemployeetableuser[id,name,money],

WritetheSQLquerytofindtheumvalueof

moneyinthetable:

WritetheSQLquerytofindthetop10peoplewiththehighestmoney,orderedbymoney

fromlargesttosmalt.

11Writeafunctiontocalculatethedifferenceweentwodates,forexample,the

datedifferenceween2007-2-5~2007-3-6.

12WriteaPHPfunctiontofindthelargestnumberfromNintegers($

文档评论(0)

1亿VIP精品文档

相关文档