|
Posted by Jerry Stuckle on 02/05/07 23:17
Gunnar G wrote:
>> A function cannot be redeclared, and this will result in an error. If they
>> do different things, you should name them different accordingly. You can
>> however declare functions in mulitple places with a conditional, allthough
>> it's not advisable (if the function changes you have to make changes all
>> over). This is done by:
>> if(!function_exists('foo')){
>> function foo(){
>> //etc...
>> }
>> }
>
> This makes me think.
>
> Imagine you enter the file mypage.php that contains a function foo, and you
> have to run the function foo that is in the file a.php.
> Then you can't include a.php, so then how do execute the code in a.php
> withouth leaving mypage.php? a.php should return one or two values back
> to mypage.php.
>
> I'd rather not rename the functions, so is there any solution to this?
Gunnar,
You don't. As Rik said - different functions should have different names.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|