You are here: Re: Dynamically load functions « PHP Programming Language « IT news, forums, messages
Re: Dynamically load functions

Posted by Janwillem Borleffs on 06/26/06 08:35

Bob Stearns wrote:
> Is there an option in php to do a 'require xxx.php' if, when a
> function call to xxx is encountered, it is not defined? It would look
> in all the standard places.
>

The best you can do is to test if the function exists and include its
definition when it doesn't:

if (!function_exists('somefunction')) {
require 'funcdef.php';
}

You can also use require_once/include_once to prevent the file being
included more than once, which causes an error because of the re-definition.


JW

 

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

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