I am not sure about efficiency, myself and I often ask this without much if
anything at all for a response. However, I am the opposite of you, in that I
prefer to create a library file containing all the functions. To make
developing the page in something like Dreamweaver or Frontpage easier, I
global all the variables of a given function, like say Function
StockQuote($sym) { }. They I include the library file in my PHP
webpage.Something like this...

<?PHP include("filepath/filename"); StockQuote($sym); ?>

various html
<?PHP print $Stock_LastPrice; ?>


In the library file, I global the variables;

function StockQuote($sym) {

global $Stock_LastPrice, $Stock_Position;
get the data...
do something with the data...
$Stock_LastPrice = This minus that blah blah;

I can use this variable anywhere I would like and it is very WYSIWYG

I am not sure how efficient it is though as I mentioned above.

"Monty" <[EMAIL PROTECTED]> wrote in message
> I generally prefer to include various blocks of code in templates using
> include_once() rather than load a functions library and make calls to
> functions within the script.
> Is there a big difference in efficiency and speed of includes vs. custom
> functions? I like includes because it's easier to drop blocks of code in a
> page design without disrupting the design of the page very much.
> Thanks,
> Monty

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to