Simple PHP question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
croniccoder
Forum Commoner
Posts: 27
Joined: Fri Jul 07, 2006 10:45 am

Simple PHP question

Post 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?
Ward
Forum Commoner
Posts: 74
Joined: Thu Jul 13, 2006 10:01 am

Post 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.
croniccoder
Forum Commoner
Posts: 27
Joined: Fri Jul 07, 2006 10:45 am

Post by croniccoder »

yes, I meant actual functions. Thanks Ward, you answered my question. :D
Post Reply