how to add global functions?
Posted: Wed Apr 14, 2010 10:22 am
i have about 5 functions that are repeating on lots of pages. How can I make a global function so I don't need to keep copying the code on each page?
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
require ("functions.php");
// do other things like opening a connection to the database
// then a method of deciding which scripts you want to run, and what page to display
require() is identical to include() except upon failure it will also produce a fatal E_ERROR level error. In other words, it will halt the script whereas include() only emits a warning (E_WARNING) which allows the script to continue.