Result 1 Int and string type cast caused ,0==="a" 0 == 0 It must be true PHP is weakly typed. . $tmp = 0 === "a"? 1: 2; echo $tmp; This is 2 4. It is known that a string is as follows: $str = "1109063 milo 1"; Use one line of code to assign 1109063 in the string to $uid, milo to $user, and 1 to $type The spaces are as follows list($uid, $user, $type) = explode(" ", $str); t is as follows list($uid, $user, $type) = explode("t", $str); list($uid, $user, $type) = sscanf($str, "%d %s %d"); $n = sscanf($auth, "%dt%s %s", $id, $first, $last); 5. List the following types of signed and unsigned ranges respectively: TINYINT SMALLINT MEDIUMINT INT TINYINT-2^7 - 2^7-10 ~ 2^8-1 SMALLINT-2^15 - 2^15-1 0 ~ 2^16-1 MEDIUMINT-2^23 - 2^23-1 0 ~ 2^24-1 INT-2^31 - 2^31-1 0 ~ 2^32-1 6. Assemble the following array into a string in one line i am milo! day day up!
7. Call the following function to get the function and get the value of count
8. Several ways to replace the session mechanism, briefly describing their respective advantages and disadvantages mysql, memcache, and cookie maintain a unique status identification code 9. Possible reasons for the following HTTP status codes and how to deal with them 200, 301, 404, 502, 503 200 The request was successful and the response headers or data body expected by the request will be returned with this response. 301 The requested resource has been permanently moved to a new location, and any future references to this resource should use one of several URIs returned with this response. If possible, clients with link editing capabilities should automatically modify the requested address to the address returned from the server. Unless otherwise specified, this response is also cacheable. The new permanent URI should be returned in the Location field of the response. Unless this is a HEAD request, the response entity should contain a hyperlink to the new URI and a brief description. If this is not a GET or HEAD request, the browser prohibits automatic redirection unless confirmed by the user, because the conditions of the request may change accordingly. Note: For some browsers that use the HTTP/1.0 protocol, when the POST request they send gets a 301 response, the subsequent redirect request will become a GET method. 404 The request failed. The requested resource was not found on the server. There is no information to tell the user whether the condition is temporary or permanent. If the server knows the situation, it should use the 410 status code to inform that the old resource is permanently unavailable due to some internal configuration mechanism problems, and there is no jump address. The 404 status code is widely used when the server does not want to reveal why the request was rejected or no other suitable response is available. 502 A server working as a gateway or proxy received an invalid response from an upstream server while trying to perform a request. 503 Due to temporary server maintenance or overload, the server is currently unable to process requests. This condition is temporary and will be restored after a period of time. If a delay can be expected, the response can include a Retry-After header to indicate the delay. If this Retry-After message is not given, the client SHOULD handle it the same way it handles a 500 response. Note: The existence of the 503 status code does not mean that the server must use it when it is overloaded. Some servers simply wish to deny connections from clients. 200 OK Everything is fine, and the response documents to GET and POST requests follow. 301 Moved Permanently The document requested by the client is elsewhere. The new URL is given in the Location header. The browser should automatically access the new URL. 404 Not Found The resource at the specified location cannot be found. This is also a common response. 502 Bad Gateway When the server acts as a gateway or proxy, it accesses the next server to complete the request, but the server returns an illegal response. 503 Service Unavailable The server failed to respond due to maintenance or overload. For example, a Servlet may return 503 when the database connection pool is full. The server can provide a Retry-After header when returning 503. 10. There is the following database, use the original mysql extension to connect and query the first ten rows of the user table host: 192.168.0.254 port: 3306 user: one pass:piece database: db_user table: user
11. Use autoload($class) to realize automatic loading of classes in the Lib directory and be compatible with subdirectories
12. Use set_error_handle to capture errors and output them, the level is determined by yourself
13. Briefly describe two methods of shielding notice warnings of PHP programs method Initialize variables, set the error level at the beginning of the file or modify php.ini to set error_reporting set_error_handler and @suppress errors 1. Add in the program: error_reporting (E_ALL & ~E_NOTICE); 2. Or modify php.ini: error_reporting = E_ALL Change to: error_reporting = E_ALL & ~E_NOTICE 3.error_reporting(0);or modify php.inidisplay_errors=Off12 3 4 Next page Last page |