A PHP programmer interview question (basic type)
A relatively basic PHP programmer interview question. The test is relatively basic, but there are many details. If the foundation is not strong, it will be difficult to pass. Friends in need, please refer to it.
1. In PHP, the name of the current script (excluding path and query string) is recorded in the predefined variable (1); and the URL linking to the current page is recorded in the predefined variable (2). 2. Executing the program segment will output (3). 3. In HTTP 1.0, the meaning of status code 401 is (4); if the prompt "File not found" is returned, the header function can be used, and its statement is (5). 4. The function of array function arsort is (6); the function of statement error_reporting(2047) is (7). 5.The database connection string format in PEAR is (8). 6. Write a regular expression to filter all JS/VBS scripts on the web page (that is, remove the script tag and its content): (9). 7. Install PHP as an Apache module. In the file http.conf, first use statement (10) to dynamically load the PHP module, and then use statement (11) to make Apache treat all files with the extension php as PHP scripts. deal with. 8. The statements include and require can include another file into the current file. The difference between them is (12); in order to avoid including the same file multiple times, you can use the statement (13) to replace them. 9. The attributes of the class can be serialized and saved to the session, so that the entire class can be restored later. The function to be used is (14). 10. The parameter of a function cannot be a reference to a variable, unless (15) is set to on in php.ini. 11.The meaning of LEFT JOIN in SQL is (16). If tbl_user records the student's name (name) and student number (ID), tbl_score records the student's (some students were expelled after the exam and there is no record of them) student number (ID) and test scores (score) as well as test subjects (subject), if you want to print out the name of each student and the corresponding total score of each subject, you can use SQL statement (17). 12. In PHP, heredoc is a special string, and its end mark must be (18). 13. Write a function that can traverse all files and subfolders in a folder. 14. Briefly describe the implementation principle of unlimited classification in the forum. 15. Design a web page so that a full-screen window pops up when it is opened, with a text box and a button in the window. After the user enters information in the text box and clicks the button, the window can be closed, while the entered information is displayed on the main web page. //Answer (fill in the blank): 1. echo $_SERVER['PHP_SELF']; echo $_SERVER["HTTP_REFERER"]; 2. 0 3. (4) Unauthorized (5) header("HTTP/1.0 404 Not Found" ); 4. (6) Reverse sort the array and maintain the index relationship (7) All errors and warnings 5. Didn’t understand 6. /<script>].*?>.*?</script>/si 7. (10) LoadModule php5_module "D:/xampp/apache/bin /php5apache2.dll" (11) AddType application/x-httpd-php-source .phps AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml 8. (12) include generates a warning require when an exception occurs Fatal error occurs (13) require_once()/include_once() 9. serialize() /unserialize() 10. allow_call_time_pass_reference 11. (16) Natural left outer join (17) select name , count(score) as sum_score from tbl_user left join tbl_score on tbl_user.ID=tbl_score.ID group by tbl_user.ID 12. The line where the end identifier is located cannot contain Any other characters except ";"13./*** Traverse the directory and store the results in an array. Supports php4 and above. After php5, the scandir() function can be used to replace the while loop. * @param string $dir* @return array*/function my_scandir($dir){ $files = array(); if ( $handle = opendir($dir) ) { while ( ($file = readdir ($handle)) !== false ) { if ( $file != ".." && $file != "." ) { if ( is_dir($dir . "/" . $file) ) { $files[ $file] = rec_scandir($dir . "/" . $file); }else { $files[] = $file; } } } closedir($handle); return $files; }}I hope the php interview questions provided above will be helpful to everyone. I wish you all good luck in finding a job. |

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Following its high-profile acquisition by Facebook in 2012, Instagram adopted two sets of APIs for third-party use. These are the Instagram Graph API and the Instagram Basic Display API.As a developer building an app that requires information from a

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio
