Home > Backend Development > PHP Tutorial > Brief description of PHP entry-level interview questions (2)

Brief description of PHP entry-level interview questions (2)

韦小宝
Release: 2023-03-17 15:30:01
Original
1761 people have browsed it

PHP Junior Interview Questions are for programmers with little experience who are just looking for a job. This provides a lot of help for us to go out for interview, InterviewOfficial meetings often test us, and the interview questions played a big role at this time.

11. Have you ever used version control software? If so, what is the name of the version control software you used?

TortoiseSVN-1.2. 6 svn-1.2.3

12. Have you ever used a template engine? If so, what is the name of the template engine you used?

  • smarty

13. Please briefly describe your most proud development work

...

14. For websites with large traffic, what methods do you use to solve the traffic problem?

  1. First, confirm whether the server hardware is sufficient to support the current traffic

  2. Secondly, optimize database access.

  3. Third, external hotlinking is prohibited.

  4. Fourth, control the download of large files.

  5. Fifth, use different hosts to divert the main traffic

  6. Sixth, use traffic analysis and statistics software.

15. Use PHP to write the code to display the client IP and server IP

function get_client_ip() {#
if(getenv('HTTP_CLIENT_IP')) {
$client_ip = getenv('HTTP_CLIENT_IP');
} elseif(getenv('HTTP_X_FORWARDED_FOR')) {
$client_ip = getenv('HTTP_X_FORWARDED_FOR');
} elseif(getenv('REMOTE_ADDR')) {
$client_ip = getenv('REMOTE_ADDR');
} else {
$client_ip = $HTTP_SERVER_VAR['REMOTE_ADDR'];
}
return $client_ip;
}
Copy after login

16. What is the difference between the statements include and require? To avoid including the same file multiple times, you can use (?) statements to replace them?

  • ##require() Identical in every respect to include() except how it handles failure. include() produces a warning and require() causes a fatal error.

  • In other words, if you want to stop processing the page when the file is missing, use require(). This is not the case with include() and the script will continue to run.

  • require() will include the file anyway, while include() can selectively include.

Use

include_once
require_once
Copy after login
# instead

##17. How to modify the survival time of SESSION

$savePath = "./session_save_dir/";
$lifeTime = 24 * 3600;
session_save_path($savePath);
session_set_cookie_params($lifeTime);
session_start();
Copy after login

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

file_get_contents($url)
Copy after login

19. In HTTP 1.0, the meaning of status code 401 Yes (?); if the prompt "File not found" is returned, the header function can be used, and its statement is (?)##Unauthorized(Unauthorized)

Header("http/1.0 403 Forbidden");
Copy after login
Don’t be anxious after reading the above interview questions. There are other interview questions. It is best to consolidate the basic things to help us interview and find jobs.

Related recommendations:

##php Brief description of junior interview questions (1)

Compilation of PHP junior interview questions

5 common questions among junior PHP developers

The above is the detailed content of Brief description of PHP entry-level interview questions (2). For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template