Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.