You are here: Re: static member of a class and inheritance « PHP Programming Language « IT news, forums, messages
Re: static member of a class and inheritance

Posted by giacomo.galilei on 09/25/06 20:55

> You can get the directory of the class script from inside the class
> using dirname(__FILE__).
>
> i.e.:
>
> == obj/foo/class.foo.php ==
>
> <?php
>
> class Foo
> {
> function bar()
> {
> // Load resources
> file_get_contents(dirname(__FILE__) . "/stuff.txt");
> }
> }
>
> ?>
>
> This will load the file obj/foo/stuff.txt, and does not matter when or
> from where Foo::bar() is called.
>

yes, it's easier and simple at the same time.. thank you
Bye

 

Navigation:

[Reply to this 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

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