1

Topic: Duplicate function names

I know this has been asked before but I can't find the topic.

I am integrating punbb to my website. How do I avoid duplicate function names? I have a function named redirect() so if I include common.php which includes functions.php, i get an error which says redirect cannot be redefined.

Re: Duplicate function names

rename your function? tongue

Re: Duplicate function names

Try, when creating functions, using a test page with function_exists() wink So you can easily check if that certain function has already been defined before. What you could do too is create a class with your own functions in it smile

4

Re: Duplicate function names

Creating a class is one solution. But I'll probably rename the function, and therefore edit all the files that uses that function. And from now on, i'll put a prefix on my functions.

I just thought there is a way to solve the problem without editing all the files.