Unholy Prayer Posted December 10, 2006 Share Posted December 10, 2006 Ok, I'm getting an error with this function and I don't know why. This is the error message that I'm getting: [quote]Fatal error: Cannot redeclare clean() (previously declared in /home/dev/public_html/portal/functions.php:9) in /home/dev/public_html/portal/functions.php on line 9[/quote]These are the contents of functions.php:[code]<?phpfunction clean($string) {$string = addslashes($string);$string = strip_tags($string);$string = htmlspecialchars($string);$string = trim($string);return $string;}?> [/code]Can someone please help me? Link to comment https://forums.phpfreaks.com/topic/30152-cannot-redclare-function/ Share on other sites More sharing options...
Psycho Posted December 10, 2006 Share Posted December 10, 2006 It looks as if you are including functions.php in multiple places. Use either include_once() or require_once() to prevent that page from being read twice. Link to comment https://forums.phpfreaks.com/topic/30152-cannot-redclare-function/#findComment-138597 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.