|
Posted by Gunnar G on 02/05/07 22:58
> 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?
Navigation:
[Reply to this message]
|