Jump to content

[SOLVED] Scope of a function in PHP


dhruvasagar

Recommended Posts

I am a beginner in PHP programming so I apologize if this is a stupid question or something that has already been answered. My question is what is the scope of a function defined in a php file?

If I want to call a function I defined in another file, do I need to do something like include that PHP file in this new PHP file or will it be just accessible? Though personally I think we'll need to include it of course...

 

The problem in searching is that when I do search for this, I end up reading excerpts for function scope, i.e. scope of variables etc which are declared within a function, that's not what I am looking for, I want to know the scope of these declared functions...

 

I have programming knowledge as well as experience in c/c++/java/VB/VC++/C#/ASP/Advanced Java/.NET etc...hence i understand most of the concepts of OOP as well as general programming.

Link to comment
https://forums.phpfreaks.com/topic/65936-solved-scope-of-a-function-in-php/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.