php interview questions2016-5-1

1. Please briefly describe the difference between the three functions of iseet.is_null and empty.
iseet checks if a variable is set.
is_null Detect whether the variable is null
empty Detect whether the variable is empty
2. Briefly describe the difference between cookie and session. Briefly describe the mechanism of session
Cookie is a mechanism for browsers to maintain state.
Session is a mechanism for server to maintain state.
Cookie has size and quantity restrictions. In theory, there is no limit to
session. Session generates a unique seeionID and stores it on the browser, and the content is stored on the server side. Relying on the unique sessionID on the browser to read the content on the server side.
3. Write a regular match that validates email addresses.
/^([\w\d_]+)@([\w\d]+(\.[\w\d]+))$/
4. Extract http://www.baidu.com/index?id =1 domain name information.
Use parse_url();print_r();
Array(
[scheme] =>http
[host] => www.baidu.com
[path] =>index?id=1
);
5. Several ways for PHP to manipulate files?
file() reads a file into an array.
file_get_contents() reads a file into a string.
fgets() reads a line from the text pointer.
fopen() fwrite() fclose();
filesize();file_exists();
6. There is a simple forum system, the administrator background can manage forum sections, and the user frontend can post, upload posts, and upload post attachments, please create A simple database table model with a brief description.
plate plate table
id int(11) auto-increment plate number
pid int(11) sub-plate id
name varchar(20) plate name
o int(11) sort ID
article post table
id int(11) auto-increment post number
title varchar(50 ) Post title
conten text Post content
send_time int(11) Post time
file varchar(255) Attachment name
pid int(11) Section ID to which it belongs.
7. Briefly describe the difference between Varchar and Char data types in Mysql database?
varChar is of variable length and will expand and contract within a limited range according to the actual length of the string.
char is a fixed length, you can allocate as much as you want.
In performance char is faster than varchar because varchar can calculate the length.
8. Briefly describe the main differences between the MyISAM storage engine and the innodb storage engine.
mysqlisam does not support transactions, nor does it support foreign keys; instead, innoDB supports transactions and also supports foreign keys.
9. Several implementations of php array deduplication.
@1.array_unique;
@2.array_flip();
array_keys();
@3.array_flip();
array_flip();
array_merge();
10.php Returns all the keys and values ​​in the array.
All keys use array_keys();
all values ​​use array_values();
The function of the function array_column in 11.php.
Get a column of values ​​from an array. Multidimensional Arrays.
array_column(array, value, key);
12. Talk about the function of php curl function.
curl can use URL syntax to emulate a browser to transfer data.
Multiple protocols are supported.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325913570&siteId=291194637