Home  >  Article  >  Backend Development  >  PHP latest interview questions sharing

PHP latest interview questions sharing

小云云
小云云Original
2018-03-21 10:02:401072browse

This article mainly shares with you the latest PHP interview questions, about the PHP framework, etc. I hope it can help you.

Which PHP frameworks have been used?

1. YII framework:

2. ThinkPHP framework:

What is the purpose of the template engine in php? Which template engines have you used?

The purpose of using a template engine is to separate the program's logic code from the HTML interface code, making the program's structure clearer.

Template engines used: Smarty, ThinkPHP’s ThinkTemplate

7. How to pass variables between pages (at least two ways)? GET, POST, COOKIE, SESSION

8. What functions related to PHP arrays do you know?

array()----Create an array

array_combine()----Create a new array by merging two arrays

range()--- -Create and return an array containing elements in the specified range

compact()----Create an array

array_chunk()----Split an array into multiple

array_merge()----Merge two or more arrays into one array

array_slice()----Remove a value from the array based on conditions

array_diff ()----Return the difference array of two arrays

array_intersect()----Calculate the intersection of arrays

array_search()----Search for a given value in the array

array_splice()----Remove Part of the array and replace it

array_key_exists()----Determine whether the specified key exists in an array

shuffle()----Put the elements in the array in random order Rearrange

array_flip()----Exchange the keys and values ​​in the array

array_reverse()----Flip the order of the elements in the original array, create a new array and return

array_unique()----Remove duplicate values ​​in the array

9 What design patterns do you know?

Factory mode, strategy mode, single element mode, observer mode, command chain mode

10 Which code version control software are often used?

Usually a project is developed by a team. Everyone submits their own code to the version server, and the project leader manages it according to the version, which facilitates version control, improves development efficiency, and ensures that when needed Can go back to the old version.

Commonly used version controller: SVN

11PHP acceleration mode/extension? PHP debugging mode/tool?

Zend Optimizer acceleration extension

Debugging tool: xdebug

12show processlist; What does this command do?

Show which threads are running

13SHOW VARIABLES; What does this command do?

Show system variables and values

14SHOW VARIABLES like ’%conn%’; What does this command do?

Display the value of the system variable name containing conn

15LEFT JOIN Write a SQL statement?

SELECT A.id,A.class FROM A LEFT JOIN B ON A.cid=B.id

16 Please write down 5 commonly used unix operation commands.

1, Ls -l

2, tar -zxvf

3, Touch

4, Cat

5, Mkdir

6, rm

17 Please write down the functions of the following five UNIX system configuration files/services.

/etc/passwd

/etc/hosts

/etc/fstab

Crontab

sshd

1./etc/passwd: User information file, which contains user name, whether the user has a password, and user ID And the group to which the user belongs

2, /etc/hosts: host name database, including IP address, host name or domain name, alias and other information. Adding records in this file can bypass DNS

3. /etc/fstab is a configuration file that saves all partition information of the system.

4. Crontab scheduled task command

5. Sshd remote connection management command

18 Please list 5 commonly used PHP functions for operating MySQL

1. Mysql_connect()

2. Mysql_select_db()

3. Mysql_query()

4. Mysql_fetch_row()

5. Mysql_close()

19What is a timestamp? How to get the current timestamp?

The timestamp is the number of seconds from 00:00:00 on January 1, 1970 to the specified date.

Get the current timestamp: time()

20There is a webpage address, such as the homepage of the PHP Development Resource Network: http://www.phpres.com/index.html, how to get its content?

Get the webpage content:

$url="http://www.phpres.com/index.html";

$str=file_get_contents($url);

21How to get the current execution script path, Including the obtained parameters

$_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI']; Get the full path and parameters of the current page.

Get parameters: $_SERVER['QUERY_STRING'];

22 How to use PHP environment variables to get the content of a web page address? How to get the ip address?

echo $_SERVER ["PHP_SELF"];

echo $_SERVER ["SERVER_ADDR"];

Related recommendations:

Summary of written test questions in php interview questions

11 most frequently asked php interview questions

php interview question sharing

The above is the detailed content of PHP latest interview questions sharing. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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