Home Backend Development PHP Tutorial 二零一零年6月PHP面试题

二零一零年6月PHP面试题

Jun 13, 2016 am 10:40 AM
id mysql nbsp php sql

2010年6月PHP面试题

2010年6月PHP面试题
2010年06月26日
  2010年6月 PHP面试题
  面试题 1 1 用 PHP 打印出前一天的时间格式是 2006-5-10 22:21:21
  print ,2 echo .print_r 区别 
  3 能够使 HTML 和 PHP 分离开使用的模板 
  4 如何实现 PHP JSP 交互? 
  5 使用哪些工具进行版本控制? 
  6 如何实现字符串翻转? 
  7 优化 MYSQL 数据库的方法。 
  8 谈谈事务处理 
  9 apache+mysql+php 实现最大负载的方法 
  10 实现中文字串截取无乱码的方法。 
  面试题 2
  var $empty       = '';
  var $null        = NULL;
  var $bool        = FA LSE;
  var $notSet;
  var $array       = arrai ;
  1.
  $a = "hello";
  $b = &$a;
  unset $b ;
  $b = "world"; 
  what is $a?
  2.
  $a = 1;
  $x = &$a;
  $b = $a++; 
  what is $b?
  3.
  $x = empti $arrai ;
  what is $x?   true    or    false
  4. 您是否用过版本控制软件 ? 如果有您用的版本控制软件的名字是 ?
  5. 您是否用过模板引擎 ? 如果有您用的模板引擎的名字是 ?
  6. 请简单论述您最得意的开发之作 .
  您采用什么样的方法来解决访问量问题 7. 对于大流量的网站 .?
  8. 用 PHP 写出显示客户端 IP 与服务器 IP 代码 :
  面试题 3
  一、 PHP/MySQL 编程 
  表 messag 有如下字段 1 某内容管理系统中。 
  id 文章 id 
  titl 文章标题 
  content 文章内容 
  category_id 文章分类 id 
  hit 点击量 
  写出 MySQL 语句 创建上表。 
  字段如下 2 同样上述内容管理系统:表 comment 记录用户回复内容。 
  comment_id 回复 id 
  id 文章 id 关联 messag 表中的 id 
  comment_cont 回复内容 
  回复最高的排在最前面 现通过查询数据库需要得到以下格式的文章标题列表 , 并依照回复数量排序。 
  文章 id 文章标题 点击量 回复数量 
  如果文章没有回复则回复数量显示为 0 用一个 SQL 语句完成上述查询。 
  表 categori 保管分类信息,3 上述内容管理系统。字段如下 
  category_id int 4 not null auto_increment; 
  categroy_nam varchar 40 not null; 
  通过选择下拉菜单选定文章分类 用户输入文章时。 
  写出如何实现这个下拉菜单 
  二、 PHP 文件操作 
  1 
  系统生成静态 HTML 页面;写出实现的基本思路 上述内容管理系统:用户提交内容后。 
  2 简单描述用户修改以发布内容的实现流程和基本思路 
  三、 PHP 顺序  1 写出以下程序的输出结果 
  $c?4:5; 
  echo $a; 
  ?> 
  2 写出以下程序的输出结果 
   
  面试题 4
  一 . 简答题 
  1. 请说明 php 中传值与传引用的区别。什么时候传值什么时候传引用? 
  2. PHP 中 error_report 这个函数有什么作用? 
  3. 请写一个函数验证电子邮件的格式是否正确 
  包括所得到参数。 4. 简述如何得到当前执行脚本路径。 
  传给他参数有参数 1 参数 2 参数 3 . 说明:例如有一个脚本 www.domain.com. 
  那么现在请写出类似 传送参数的方法有可能是 GET 有可能是 POST. 
  http://www.domain.com/script.php? 参数 1= 值 1& 参数 2= 值 2..... 结果 
  5. 如何修改 SESSION 生存时间 . 
  如何得到内容? 6.. 有一个网页地址 http://www.domain.com/xxx.php. 
  里面存储整形数据,7. 有一个一维数组。请写一个函数,将他按从大到小的顺序排列。要求执行效率高。并说明如何改善执行效率。该函数必需自己实现,不能使用 php 函数) 
  8. 请举例说明在开发过程中用什么方法来加快页面的加载速度。 
  二 . 数据库设计题: 
  请设计一套图书馆借书管理系统的数据库表结构;可以记录基本的用户信息、图书信息、借还书信息;数据表的个数不超过 6 个;请画表格描述表结构(需要说明每个字段的字段名、字段类型、字段含义描述) 
  数据库设计中应: 
  1 . 保证每个用户的唯一性; 
  2 . 保证每种图书的唯一性;每种图书对应不等本数的多本图书;保证每本图书的唯一性; 
  应同时考虑借书行为与还书行为,3. 借书信息表中。考虑借书期限; 
  4 . 保证借书信息表与用户表、图书信息表之间的参照完整性; 
  5 . 限制每个用户最大可借书的本数 
  保证自动生成其唯一性标识 6 . 若有新用户注册或新书入库。 
  7 . 为以下的一系列报表需求提供支持: 
  不需编写实现语句,无特定说明。而需在数据库设计中,保证这些报表可以用最多一条 SQL 语句实现) 
  a 日统计报表:当日借书本数、当日还书本数报表; 
  b 实时报表: 
  i. 当前每种书的借出本数、可借本数; 
  ii. 当前系统中所有超期图书、用户的列表及其超期天数 
  分用户列出(包括没有借书行为的用户)请编写实现此需求的 SQL 语句: iii. 当前系统中所有用户借书的本数。 
  数据库应用: 
  分别描述完整的借书行为与还书行为;并保证这一系列的 SQL 语句的执行完整性 请撰写一系列的 SQL 语句。 
  如不能完成我将无法给出评判结果!所以请写出详细的回答,下题是检验能力之最重要测试。并保证答案是可以执行的顺序。两日内将结果通过电子邮件寄到 [email protected] 邮箱 
  用一种数据库实现,结合第二题中你设计。要求使用三层结构或者多层结构,要求采用面向对象的思想进行编程,有可能的话,设计一套模板机制来实现之。 
  按日期排列 功能:列出当前借出图书的情况 . 
  编号 用户姓名 书名 书的编号 借出日期 
  1. 张进 大染坊 12576587 2004-9-1 
  2. 刘兴 西游记 32131098 2004-9-2 
  面试题 5
  当前脚本的名称(不包括路径和查询字符串)记录在预定义变量( 1 中;而链接到当前页面的 URL 记录在预定义变量( 2 中。 1. PHP 中。 
  2. 执行顺序段  将输出( 3 
  状态码 401 含义是 4 如果返回 " 找不到文件 " 提示,3. HTTP 1.0 中。则可用 header 函数,其语句为( 5 
  4. 数组函数 arsort 作用是 6 语句 error_report 2047 作用是 7 
  5.PEA R 中的数据库连接字符串格式是 8 
  过虑网页上的所有 JS/VBS 脚本(即把 script 标志及其内容都去掉) 9 6. 写出一个正则表达式。 
  然后再用语句( 11 使得 Apach 把所有扩展名为 php 文件都作为 PHP 脚本处置。 7. 以 Apach 模块的方式装置 PHP 文件 http.conf 中首先要用语句( 10 动态装载 PHP 模块。 
  区别是 12 为了防止多次包括同一文件,8. 语句 includ 和 requir 都能把另外一个文件包含到当前文件中。可以用语句( 13 来代替它 
  从而以后可以恢复整个类,9. 类的属性可以序列化后保存到 session 中。这要用到函数是 14  除非在 php.ini 中把( 15 设为 on. 10. 一个函数的参数不能是对变量的引用。 
  则可以用 SQL 语句( 17 11.SQL 中 LEFT JOIN 含义是 16 如果 tbl_user 记录了学生的姓名 ( name 和学号 ( ID tbl_score 记录了学生(有的学生考试以后被开除了没有其记录)学号 ( ID 和考试成绩 ( score 以及考试科目 ( subject 要想打印出各个学生姓名及对应的各科总成绩。 
  heredoc 一种特殊的字符串,12. PHP 中。结束标志必需( 18 
  能够遍历一个文件夹下的所有文件和子文件夹。 13. 写一个函数。 
  14. 简述论坛中无限分类的实现原理。 
  使得打开它时弹出一个全屏的窗口,15. 设计一个网页。该窗口中有一个文本框和一个按钮。用户在文本框中输入信息后点击按钮就可以把窗口关闭,而输入的信息却在主网页中显示。 
  面试题 6
  将所有的 menu 列出来。 有一表 menu mainmenu,submenu,url , 请用递归法写出一树形菜单。 
  面试题 7
  写顺序求出其最大值。 1- 给你三个数。 
  php,2- 谈谈 asp.jsp 优缺点 
  3- 谈谈对 mvc 认识 
  4- 写动身贴数最多的十个人名字的 SQL 利用下表: 
  username,   member id.posts,pass,email 
  面试题 8
  1- 如何通过 javascript 判断一个窗口是否已经被屏蔽。 
  2- 写出 session 运行机制 
  按从小到大的顺序列出。 3- 有一数组 $a=arrai 4,3,8,9,2 ; 请将其重新排序。 
  4- 防止 SQL 注射漏洞一般用 _____ 函数。 
  并能处置异常掉线的 SQ5- 查询在线人数。L
  ....WHERE ________

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Mandragora: Whispers Of The Witch Tree - How To Unlock The Grappling Hook
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1666
14
PHP Tutorial
1273
29
C# Tutorial
1253
24
MySQL: The Database, phpMyAdmin: The Management Interface MySQL: The Database, phpMyAdmin: The Management Interface Apr 29, 2025 am 12:44 AM

MySQL and phpMyAdmin can be effectively managed through the following steps: 1. Create and delete database: Just click in phpMyAdmin to complete. 2. Manage tables: You can create tables, modify structures, and add indexes. 3. Data operation: Supports inserting, updating, deleting data and executing SQL queries. 4. Import and export data: Supports SQL, CSV, XML and other formats. 5. Optimization and monitoring: Use the OPTIMIZETABLE command to optimize tables and use query analyzers and monitoring tools to solve performance problems.

Composer: Aiding PHP Development Through AI Composer: Aiding PHP Development Through AI Apr 29, 2025 am 12:27 AM

AI can help optimize the use of Composer. Specific methods include: 1. Dependency management optimization: AI analyzes dependencies, recommends the best version combination, and reduces conflicts. 2. Automated code generation: AI generates composer.json files that conform to best practices. 3. Improve code quality: AI detects potential problems, provides optimization suggestions, and improves code quality. These methods are implemented through machine learning and natural language processing technologies to help developers improve efficiency and code quality.

Steps to add and delete fields to MySQL tables Steps to add and delete fields to MySQL tables Apr 29, 2025 pm 04:15 PM

In MySQL, add fields using ALTERTABLEtable_nameADDCOLUMNnew_columnVARCHAR(255)AFTERexisting_column, delete fields using ALTERTABLEtable_nameDROPCOLUMNcolumn_to_drop. When adding fields, you need to specify a location to optimize query performance and data structure; before deleting fields, you need to confirm that the operation is irreversible; modifying table structure using online DDL, backup data, test environment, and low-load time periods is performance optimization and best practice.

What is the significance of the session_start() function? What is the significance of the session_start() function? May 03, 2025 am 12:18 AM

session_start()iscrucialinPHPformanagingusersessions.1)Itinitiatesanewsessionifnoneexists,2)resumesanexistingsession,and3)setsasessioncookieforcontinuityacrossrequests,enablingapplicationslikeuserauthenticationandpersonalizedcontent.

How to uninstall MySQL and clean residual files How to uninstall MySQL and clean residual files Apr 29, 2025 pm 04:03 PM

To safely and thoroughly uninstall MySQL and clean all residual files, follow the following steps: 1. Stop MySQL service; 2. Uninstall MySQL packages; 3. Clean configuration files and data directories; 4. Verify that the uninstallation is thorough.

An efficient way to batch insert data in MySQL An efficient way to batch insert data in MySQL Apr 29, 2025 pm 04:18 PM

Efficient methods for batch inserting data in MySQL include: 1. Using INSERTINTO...VALUES syntax, 2. Using LOADDATAINFILE command, 3. Using transaction processing, 4. Adjust batch size, 5. Disable indexing, 6. Using INSERTIGNORE or INSERT...ONDUPLICATEKEYUPDATE, these methods can significantly improve database operation efficiency.

How to use MySQL functions for data processing and calculation How to use MySQL functions for data processing and calculation Apr 29, 2025 pm 04:21 PM

MySQL functions can be used for data processing and calculation. 1. Basic usage includes string processing, date calculation and mathematical operations. 2. Advanced usage involves combining multiple functions to implement complex operations. 3. Performance optimization requires avoiding the use of functions in the WHERE clause and using GROUPBY and temporary tables.

Detailed explanation of the installation steps of MySQL on macOS system Detailed explanation of the installation steps of MySQL on macOS system Apr 29, 2025 pm 03:36 PM

Installing MySQL on macOS can be achieved through the following steps: 1. Install Homebrew, using the command /bin/bash-c"$(curl-fsSLhttps://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)". 2. Update Homebrew and use brewupdate. 3. Install MySQL and use brewinstallmysql. 4. Start MySQL service and use brewservicesstartmysql. After installation, you can use mysql-u

See all articles