note 70917 added to function.mime-content-type
| From: | tree2054usinghotmail at osu1 dot php dot net | Date: | Sat, 04 Nov 2006 01:59:33 +0000 |
| Subject: | note 70917 added to function.mime-content-type | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-119358@lists.php.net to get a copy of this message | ||
The correct little correction:
exec will return the mime with a newline at the end, the trim() should be called with the result of
exec, not the other way around.
<?php
if ( ! function_exists ( 'mime_content_type ' ) )
{
function mime_content_type ( $f )
{
return trim ( exec ('file -bi ' . escapeshellarg ( $f ) ) ) ;
}
}
?>
----
Server IP: 64.71.164.2
Probable Submitter: 70.19.150.233
----
Manual Page -- http://www.php.net/manual/en/function.mime-content-type.php
Edit -- https://master.php.net/note/edit/70917
Del: integrated -- https://master.php.net/note/delete/70917/integrated
Del: useless -- https://master.php.net/note/delete/70917/useless
Del: bad code -- https://master.php.net/note/delete/70917/bad+code
Del: spam -- https://master.php.net/note/delete/70917/spam
Del: non-english -- https://master.php.net/note/delete/70917/non-english
Del: in docs -- https://master.php.net/note/delete/70917/in+docs
Del: other reasons-- https://master.php.net/note/delete/70917
Reject -- https://master.php.net/note/reject/70917
Search -- https://master.php.net/manage/user-notes.php