kostanza Posted June 11, 2013 Share Posted June 11, 2013 Hello, thank you for taking the time to look at my problem. I am getting this error. The php won't work. function mime_content_type($f){$f = escapeshellarg($f);return trim( `file -bi $f` );} It's saying that only the "}" on the last line is the source of the error. Any help as to why would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/279031-fatal-error-cannot-redeclare-mime_content_type/ Share on other sites More sharing options...
PravinS Posted June 11, 2013 Share Posted June 11, 2013 (edited) replace tilt(`) character with quote (") in the line return trim( "file -bi $f" ); Edited June 11, 2013 by PravinS Quote Link to comment https://forums.phpfreaks.com/topic/279031-fatal-error-cannot-redeclare-mime_content_type/#findComment-1435307 Share on other sites More sharing options...
mac_gyver Posted June 11, 2013 Share Posted June 11, 2013 your function name is the same as a php built in function. use a different name for your function. @PravinS, the back-tick syntax in php is used for executing an operating system shell command. Quote Link to comment https://forums.phpfreaks.com/topic/279031-fatal-error-cannot-redeclare-mime_content_type/#findComment-1435315 Share on other sites More sharing options...
kostanza Posted June 12, 2013 Author Share Posted June 12, 2013 Thank you for the replys! I tryed changing the ' to " but that didnt work, also, im not very good at PHP, what should I change the function name to? I searched php.net for functions but not sure what to do. Thank you again for all your help! Quote Link to comment https://forums.phpfreaks.com/topic/279031-fatal-error-cannot-redeclare-mime_content_type/#findComment-1435477 Share on other sites More sharing options...
trq Posted June 12, 2013 Share Posted June 12, 2013 I tryed changing the ' to " but that didnt work Did you read the last reply? what should I change the function name to? Oh... you did. Change it to whatever you like. Quote Link to comment https://forums.phpfreaks.com/topic/279031-fatal-error-cannot-redeclare-mime_content_type/#findComment-1435490 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.