You are here: Re: Parsing a PHP file « PHP Programming Language « IT news, forums, messages
Re: Parsing a PHP file

Posted by Rami Elomaa on 05/01/07 04:19

Ryan Govostes kirjoitti:
> In my PHP script, I'd like to examine another PHP file to get
> information on the classes it will define before I include it
> (alternatively, getting a list of the classes after I've included it
> would be fine too).

I'm curious, what would you do with this info?

Anyway, as you said, there is get_defined_classes and I think what you
are trying might be accomplished thusly:

$before = get_defined_classes();

include('file.inc.php');

$declared = array_diff(get_defined_classes(), $before);

print_r($declared);

--
Rami.Elomaa@gmail.com

"Wikipedia on vähän niinq internetin raamattu, kukaan ei pohjimmiltaan
usko siihen ja kukaan ei tiedä mikä pitää paikkansa." -- z00ze

 

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

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