PHP初级程序员能力测试题,综合性比较强,高手可陆续回复答案~
PHP入门级CODER自测题
说明:本测试满分100分,涉及了WEB(Php方向)的综合知识,90分及格。
BY:PIG 2009.07.14
这题发过一次,现在整理一下,重新发上来。
-------------------------------------
一,基础PHP
1.试阐述echo和print,require和include的区别。(3分)
2.用至少两种方法去除一个数组中重复的元素。(3分)
3.简述$_GET,$_POST的用法和区别。(4分)
4.试述COOKIE和SESSION的用法和区别,以及它们之间的联系。(6分)
5.不借助中间变量交换两个变量的值。(3分)
6.什么叫转义?为什么要转义?(3分)
7.构造一个从a到z的数组。(2分)
8.试说明符号->,=>的用法,以及$this,$that的用法。(3分)
9.定义一个抽象类student,然后由子类cs继承并实现它的一个抽象方法do_homework()。(5分)
二.前台WEB基础
10.试说明class和id的区别。(2分)
11.获取一个ID为KEY的DIV里的内容,并在此DIV里添加一个LI标签,其中文本节点内容为
“我是一个li”。(4分)
12.利用CSS技术实现横向菜单。(5分)
13.怎样实现子窗口对父框架的刷新。(2分)
三.数据库基础
14.代码实现更改MUSIC数据库里所有数据表的表名。(5分)
15.有一数据表,含5个字段(cid ,ctitle,cbody,cauthor,ctime),现要求从中取出第800000条记录后的40条记录的所有字段。(4分)
16.怎样将一个数组对象存储到数据表中的一个字段内。(2分)
17.试比较MYSQL中, MYISAM和INNODB两种存储模式的优缺点和使用场合。(3分)
18.试述一些MYSQL优化的方法。(4分)
四.算法及其他。
19.md5()是加密算法吗?在会员注册中怎样保护密码不轻易被破解?(3分)
20.试述“密码找回”功能的思路及代码实现。(5分)
21.对一个基本有序的小规模数组进行排序。(4分)
22.现要建立一个城市的公交查询站点,请实现其数据库结构设计。(5分)
23.构造一个匹配当前所有移动电话的正则,包括移动,联通,电信。(3分)
24.利用正则或其他方法实现为数字添加逗号,形如32,995,145.(4分)
25.已知UPC码,即我们常说的商品条码,一共有13位,其中前三位为国家代码(中国为691,692,693),最后一位为校验位,校验规则如下
Sum=(a1+3a2+a3+3a4+…+an-1)
Sum+check=0 mod 10,用代码实现其验证过程。(3分)
26.求出小于100亿的素数的个数,以及其中9位数的素数的个数。(4分)
27.理解MVC,及其静态化目录的实现。(6分)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP is a scripting language widely used on the server side, especially suitable for web development. 1.PHP can embed HTML, process HTTP requests and responses, and supports a variety of databases. 2.PHP is used to generate dynamic web content, process form data, access databases, etc., with strong community support and open source resources. 3. PHP is an interpreted language, and the execution process includes lexical analysis, grammatical analysis, compilation and execution. 4.PHP can be combined with MySQL for advanced applications such as user registration systems. 5. When debugging PHP, you can use functions such as error_reporting() and var_dump(). 6. Optimize PHP code to use caching mechanisms, optimize database queries and use built-in functions. 7

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.

PHP and Python each have their own advantages, and the choice should be based on project requirements. 1.PHP is suitable for web development, with simple syntax and high execution efficiency. 2. Python is suitable for data science and machine learning, with concise syntax and rich libraries.
