![]() |
fatal error
Hi,
Can any one tell me why i get this error:: Fatal error: Cannot redeclare date_diff() in C:\wamp\www\kamsar012010_local\includes\functions. php on line 26 And my function.php is---> PHP Code:
|
You are getting that message because there's already a function called date_diff which has been declared. If you get this message, it means that
1) you have included code more than once which contains the same function, 2) have written code in more than one place which has the same function name, or 3) are trying to create a function which has the same name as a PHP function In this instance it's #3: http://nz.php.net/date_diff |
hmm... I have used the same include directory in admin folder also .
is that the problem??? |
No, the problem is the function has already been declared because it's a built-in PHP function. Either use the PHP function and remove your function with the same name, or name your one something different.
|
how should i do that ??
am a beginner in php:( |
Change
function date_diff($date1, $date2) { to function date_diff_some_other_name_that_doesnt_clash_with_t he_built_in_function_of_the_same_name($date1, $date2) { |
Thanks Dude the error has gone..:)
|
| All times are GMT. The time now is 03:22 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0