Page 1 of 1

Simple PHP question

Posted: Tue Jul 18, 2006 9:58 am
by croniccoder
When a require statement is included in a php file (ex: <?php require db.php ?> ), and let's say db.php contained several functions, are those functions invoked just by the mere fact that we used a required statement?

Posted: Tue Jul 18, 2006 10:01 am
by Ward
When you say functions, do you mean actual functions, or just lines of code? If db.php just has lines of code in it, then yes it will be run. However, if it contains functions, you still have to call those.

Posted: Tue Jul 18, 2006 10:02 am
by croniccoder
yes, I meant actual functions. Thanks Ward, you answered my question. :D