A copy of PHP's face test _php tutorial

Source: Internet
Author: User
  1. In PHP, the name of the current script (not including the path and query string) is recorded in the predefined variable (1), while the URL linked to the current page is recorded in the predefined variable (2).
  2. echo $_server[' php_self ']; echo $_server["Http_referer"];

  3. The execution program segment outputs (3).
  4. 0

  5. In HTTP 1.0, the meaning of status code 401 is (4); If you return a prompt for "file not found", the header function is available with the statement (5).
  6. (4) Unauthorized (5) header ("http/1.0 404 Not Found");

  7. The function of array functions Arsort is (6); the function of statement error_reporting (2047) is (7).
  8. (6) Reverse order and maintain index relationship (7) all errors and warnings

  9. The database connection string format in Pear is (8).
  10. Write a regular expression that js/vbs all the scripts on the Web page (that is, remove the tags and their contents): (9).
  11. /<[^>].*?>.*?<\/>/si

  12. To install PHP as an Apache module, the first thing to do is to dynamically load the PHP module with a statement (10) in the file http.conf, and then use the statement (11) to make Apache file All files with PHP extensions as PHP scripts.
  13. (Ten) LoadModule php5_module "D:/xampp/apache/bin/php5apache2.dll" (one) AddType application/x-httpd-php-source. Phps AddType application/x-httpd-php. php. php5. PhP4. php3. phtml

  14. Both the statement include and the require can include another file in the current file, with the difference being (12); To avoid including the same file multiple times, you can replace them with statements (13).
  15. (12) When an exception occurs, the include generates a warning require a fatal error (require_once ()/include_once ()

  16. The properties of the class can be serialized and saved to the session so that the entire class can be restored later, and the function to be used is (14).
  17. Serialize ()/unserialize ()

  18. A function's argument cannot be a reference to a variable unless (15) is set to on in PHP.ini.
  19. Allow_call_time_pass_reference

  20. The meaning of the left join in SQL is (16). If Tbl_user records the student's name (name) and school number (ID), Tbl_score records the student (ID) and test score (score) and the test subject (subject), which were expelled from the student's exams, without their records. To print out each student's name and the corresponding total, the SQL statement (17) can be used.
  21. (16) Natural left outer connection (+) select Name, Count (score) as Sum_score from Tbl_user to join Tbl_score on Tbl_user.id=tbl_score.id Gro Up by Tbl_user.id

  22. In PHP, Heredoc is a special string, and its end flag must be (18).
  23. The line where the end identifier is located cannot contain any other characters except ";"

  24. Write a function that can traverse all the files and subfolders under a folder.
  25. /*** traversal of the directory, the result is stored in an array. Support PHP4 and above. PHP5 can replace the while loop with the Scandir () function later. * @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;    
  26. The realization principle of infinite classification in the forum is briefly introduced.
  27. Design a Web page that pops up a full-screen window with a text box and a button open. The user clicks the button to close the window while entering the information in the text box, and the input information is displayed on the main page.

http://www.bkjia.com/PHPjc/752569.html www.bkjia.com true http://www.bkjia.com/PHPjc/752569.html techarticle In PHP, the name of the current script (not including the path and query string) is recorded in the predefined variable (1), while the URL linked to the current page is recorded in the predefined variable (2). Ech ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.