How can I call one PHP script from another?

If you would like to reference a PHP script from within another PHP script, use either the include() or require() functions.

For example, if you want to store functions for all of your pages in a file named 'foo.php,' you could reference that file like this:

include ('/foo.php');
  • Was this article helpful?

  • Yes
  • No

Still need help?