Reply to Re: [PHP] include file to global scope

Your name:

Reply:


Posted by Jochem Maas on 10/12/05 12:26

Claudio wrote:
> Hi,
>
> I'm using PHP 5. I have a class operation that includes php files.
> Is there a way to include this files to global scope? So that difined vars
> and functions are global accesseble?
>

first off I would recommend that you 'pollute' your global scope as little as
possible.

secondly could you describe what you are trying to do and why exactly -
stuff like this has been solved before but its hard to recommend a strategy when
one doesn't know what the underlying idea/direction is ....

that said the solution will probably involve the use of the 'global'
keyword.


> I saw that some PHP functions have a context parameter, is something like
> this in "eval" or "include" possible?

I think you mean then 'context' param related to functions that work with
streams - this is not AFAIK related to [variable] 'scope'.

also eval() sucks (unless there is no other way to do something, in which case
its lovely ;-).

>
> Thanks,
>
> Claudio
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация