Why PHP says redeclare?
Posted: Wed Oct 15, 2014 8:46 am
I have a myfunctions.php file where I am listing all the require('function1.php') that I need. Its just a function file listing.
Im trying to use a function from http://pgregg.com/projects/php/ip_in_range/ that detects if an IP is in a range.
So I copied his function and putted it on a file that then I included in myfunctions.php.
Now, I just wanted to be sure there were no errors so I opened myfunctions.php and I have this error:
[text]Fatal error: Cannot redeclare float2largearray() (previously declared in /home/www/registrocr.com/editor/workspace/syscon/functions/bitwise_float.php:19) in /home/www/registrocr.com/editor/workspace/syscon/functions/bitwise_float.php on line 27[/text]
So I went to the file and I found that line 19 is where the function is declared and line 27 is where the ending } for that function is.
The same thing happens with any of the functions on the bitwise_float.php file.
I am not redeclaring anything, I can't understand why PHP says this.
Any help would be much appreciated.
As you can notice, Im just begining with php.
Im trying to use a function from http://pgregg.com/projects/php/ip_in_range/ that detects if an IP is in a range.
So I copied his function and putted it on a file that then I included in myfunctions.php.
Now, I just wanted to be sure there were no errors so I opened myfunctions.php and I have this error:
[text]Fatal error: Cannot redeclare float2largearray() (previously declared in /home/www/registrocr.com/editor/workspace/syscon/functions/bitwise_float.php:19) in /home/www/registrocr.com/editor/workspace/syscon/functions/bitwise_float.php on line 27[/text]
So I went to the file and I found that line 19 is where the function is declared and line 27 is where the ending } for that function is.
The same thing happens with any of the functions on the bitwise_float.php file.
I am not redeclaring anything, I can't understand why PHP says this.
Any help would be much appreciated.
As you can notice, Im just begining with php.