Reply to Functions v includes

Your name:

Reply:


Posted by Richard on 02/16/07 13:00

I am new to php and am looking for some quick "get up and go" help.

What would the arguments for and against be for function declarations v
simple include?

e.g

<?php
include("myfunc.php"); // declares a function "myfunc".
myfunc("hello");
?>

and

<?php
include("myfunc.php"); // just a bunch of php code with no function
?>

Does PHP cache the functions? Must functions be included on all pages
which use them? The plethora of web resources makes some of this a
trifle confusing and difficult/time consuming to pin down, so any best
practice pointers much appreciated.

Would you keep functions & includes seperate from the main pages? is it
then necessary to specify a fully qualified name when including them or
should one just set the include_path in a header? Can the include path
just be set once for a single session? or in every file which references
includes? Can you recommend a web resource which covers this type of stuff?

[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

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