How to dynamically create a Web site with PHP_PHP tutorial
WBOY
Release: 2016-07-21 15:25:03
Original
790 people have browsed it
PHP has 4 functions for using external functions: include(), include_once(), require() and require_once(). In order to use them, the following lines of code will be included in the PHP script: include_once(' arr.php'); require('/path/to/filename.html'); The difference between two types of external functions: It is exactly the same to use, but it will be different when an error occurs : If the include() function does not work, a script will be printed to the web browser, but the script will continue to run. If require() fails, an error will be printed and the script will terminate. There is also a *_once() version of these two functions, which guarantees that the file being considered will only be included once, regardless of how many times the script may try to include it. eg:
Copy code The code is as follows:
require('arr1.php'); include('arrsort.php'); ?>
Use PHP's binding ability to process HTML forms
require('arr1.php'); //Include the file to be executed first if(isset($_POST['name'])) //Determine whether to enter, and then execute.. { $name=$_POST['name']; echo "$name"; } ?>
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