Page 1 of 1
Calling functions from another file
Posted: Wed Jul 09, 2003 5:35 pm
by php_wiz_kid
Is it possible to call a function from another file which is called by require()?
Posted: Wed Jul 09, 2003 5:46 pm
by cactus
Thats the whole point of include/require, they allow you to separate your code/classes etc in to descrete files/packages to be made available across your applications.
Regards,
Posted: Wed Jul 09, 2003 5:48 pm
by php_wiz_kid
That's what I thought but I get an error when I try to call a function which is stored in another PHP file that I have included into the page with require().
Posted: Wed Jul 09, 2003 5:50 pm
by php_wiz_kid
I found the problem. I don't have a brain.
Posted: Wed Jul 09, 2003 5:50 pm
by Galahad
Could you show us some code? That may help.
Nevermind... too late.
Posted: Wed Jul 09, 2003 6:12 pm
by mudkicker
php_wiz_kid wrote:I don't have a brain.
Come on, man!
You are the one

(like all PHP programmer)

Posted: Wed Jul 09, 2003 6:16 pm
by php_wiz_kid
Haha! Thanks, I'm just learning how to do functions in PHP. It's exactly like C++ but my teacher confused me so much I have to start from scratch. Thanks everyone!