PHP interview questions - the difference between title

echo , Print , print_r , var_dump difference

 

    echo and print are language structure, print_r and var_dump is a normal function

    echo : output one or more strings

    Print : output string

    print_r : print easy to understand information about variables

    var_dump : print easy to understand information about the variables ( with type )

 

 

isset and empty distinction

 

isset : Determine whether a variable is set and the non- NULL

 

empty : determining whether the variable is empty, variable 0 / false will be considered empty; variable does not exist, no warning

 

 

static , Self , $ the this difference

 

static : static can be used for static or non-static method, a static attribute may be, static methods, static methods and non-constant access to the class, but can not access non-static properties

 

self : static property can be used to access the class, static methods and constants, but self points to the currently defined class is located, which is self limiting

 

the this $ : points to the object of the actual call, that is to say, the actual operation, who calls the property or method of a class, $ the this point is which object.

 

 

includerequireinclude_oncerequire_once 的区别

require and include almost exactly the same, except different way than treatment failure. require generated when an error E_COMPILE_ERROR level error. In other words will cause the script to abort, but include produce only a warning ( E_WARNING ), the script will continue

include_once statement includes and evaluates the specified file during script execution. This behavior and include statements similar, the only difference being that if the file has already been included too, will not be included again. As the name implies, it contains only one

 

 

post and get difference?

 

get is to obtain data from the server, POST is transferring data to the server

 

get security is very low, POST high security. But the efficiency than the Post method is better

 

get the amount of data transfer is small, not greater than 2KB . post the amount of data transmitted is large, generally the default is not limited .

 

session and cookies difference

 

       1. Save in: the cookie stored in the client, the session is stored in the server

 

        2. Security: the cookie poor security, the session high security

 

        3. Life Cycle: both disappear after the browser is closed without setting conditions

 

        (Can be set on the client side cookie survival time can also be set up on the server session survival time)

 

         Relationship between the two --session by cookie achieved

 

 Note: If the client is disabled the cookie , the session will not work (Solution: Re the URL of )

 

 

MyISAM and InnoDB differences

 

1. Transaction Security ( MyISAM does not support transactions, INNODB support services)

 

2. Foreign key MyISAM does not support foreign keys, INNODB support foreign keys .

 

3. The lock mechanism ( MyISAM Table lock, InnoDB row lock)

 

4. Query and addition rate ( MyISAM bulk insertion speed)

 

5. supports full-text indexing ( MyISAM supports full-text indexing, INNODB does not support full-text indexing)

 

6.MyISAM memory space usage than InnoDB low

 

 

HTTPS and HTTP difference

 

1 , HTTPS protocol needs to ca apply for a certificate, generally less free certificates, thus requiring a fee.

 

2 , HTTP hypertext transfer protocol, information is transmitted in the clear, HTTPS it is a security ssl encrypted transmission protocol.

 

. 3 , HTTP and https use is completely different connections, with the port are not the same, the former is 80 , which is 443 .

 

. 4 , http connection is very simple, is stateless; the HTTPS protocol is SSL + HTTP constructed encrypted transmission protocol, a network authentication protocol than http protocol security.

 

2019-09-01 21:31:14

 

Guess you like

Origin www.cnblogs.com/zhaoguofeng/p/11443753.html