© Frank M. Kromann 2016

Frank M. Kromann, PHP and MySQL Recipes, 10.1007/978-1-4842-0605-8_7

7. Files and Directories

Frank M. Kromann

(1)Trabuco Canyon, California, USA

In this chapter we are going to discuss two basic ways that files are used with PHP. The first one is the script with the PHP code in the form of the main script file and includes any files that the script might use. The second one is in the form of more content or data that is read off the local or remote file system and processed by the script.

Recipe 7-1. Include and Require

Problem

When PHP is used to execute or interpret a script it always starts with a single file. This can be as an input parameter to the command-line version of PHP (php-cli) or indirectly from a web server request ...

Get PHP and MySQL Recipes: A Problem-Solution Approach, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.