A PHP interview question_PHP tutorial
- In PHP, the name of the current script (excluding the 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).
- Execution program segmentwill output (3).
- In HTTP 1.0, the meaning of status code 401 is (4); if a "File not found" prompt is returned, the header function can be used, and its statement is (5).
- The function of array function arsort is (6); the function of statement error_reporting(2047) is (7).
- The database connection string format in PEAR is (8).
- Write a regular expression to filter all JS/VBS scripts on the web page (that is, remove the tags and their contents): (9).
- To install PHP as an Apache module, first use statement (10) in the file http.conf 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.
- The statements include and require can both 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 replace them with statement (13).
- The attributes of the class can be serialized and saved to the session, so that the entire class can be restored later. The function used is (14).
- The parameter of a function cannot be a reference to a variable, unless (15) is set to on in php.ini.
- 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 number (ID), test score (score), and test subject (some students were expelled after taking the exam, and there is no record of them). 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).
- In PHP, heredoc is a special string, and its end flag must be (18).
- Write a function that can traverse all files and subfolders in a folder.
- Briefly describe the implementation principle of unlimited classification in the forum.
- 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.
echo $_SERVER['PHP_SELF']; echo $_SERVER["HTTP_REFERER"];
0
(4) Unauthorized (5) header("HTTP/1.0 404 Not Found");
(6) Reverse sort the array and maintain the index relationship (7)All errors and warnings
/<[^>].*?>.*?>/si
(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
(12) include generates a warning when an exception occurs and require generates a fatal error (13) require_once()/include_once()
serialize() /unserialize()
allow_call_time_pass_reference
(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
The line containing the terminating identifier cannot contain any other characters except ";"
/** * 遍历目录,结果存入数组。支持php4及以上。php5以后可用scandir()函数代替while循环。 * @param string $dir * @return array */ 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; } }

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

In this chapter, we will understand the Environment Variables, General Configuration, Database Configuration and Email Configuration in CakePHP.

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

To work with date and time in cakephp4, we are going to make use of the available FrozenTime class.

To work on file upload we are going to use the form helper. Here, is an example for file upload.

In this chapter, we are going to learn the following topics related to routing ?

CakePHP is an open-source framework for PHP. It is intended to make developing, deploying and maintaining applications much easier. CakePHP is based on a MVC-like architecture that is both powerful and easy to grasp. Models, Views, and Controllers gu

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

Validator can be created by adding the following two lines in the controller.
