Posted by Richard on 02/16/07 15:02
"Captain Paralytic" <paul_lautman@yahoo.com> writes:
> On 16 Feb, 13:00, Richard <rgr...@gmail.com> wrote:
>> 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?
>
> Think furthr than functions. Create classes with methods then
> instantate objects.
>
Classes haven't even entered the picture yet.
[Back to original message]
|