PHP include

From Wiki @ Karl Jones dot com
Revision as of 19:47, 19 September 2016 by Karl Jones (Talk | contribs)

Jump to: navigation, search

In PHP, the include and require keywords copies the contents of one file into other file.

This is useful for making a file (such as the header section of a web page) which is included into many web pages.

include is optional: if the specified file does not exist, PHP ignores the include.

require is not optional: if the specified file does not exist, PHP generates an error.

Example

Here is a PHP page named message.php Here is a PHP page named some-page.php:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8"/>	
		<title>HTML 5 example:  minimum required elements</title>
	</head>
	<body>

	</body>
</html>

See also

External links