note 75597 added to ref.fileinfo
| From: | mwwaygooAThotmailDOTcom at osu1 dot php dot net | Date: | Thu, 07 Jun 2007 13:25:03 +0000 |
| Subject: | note 75597 added to ref.fileinfo | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127268@lists.php.net to get a copy of this message | ||
Be careful of using system("file -i -b file.pdf");
I got some strange results as follows:-
1.
<?php
$type=system("file -i -b mime.php");
echo $type;
?>
text/plain; charset=us-ascii
text/plain; charset=us-ascii
2.
<?php
$type=system("file -i -b mime.php");
echo $type."<br/>\n";
$split=split(";",$type);
print_r($split);
$type=trim($split[0]);
echo $type;
?>
text/plain; charset=us-ascii
text/plain; charset=us-ascii<br/>
Array
(
[0] => text/plain
[1] => charset=us-ascii
)
text/plain
3.
<?php
$type=@system("file -i -b mime.php");
//echo $type."<br/>\n"; // just comment this line
$split=split(";",$type);
print_r($split);
$type=trim($split[0]);
echo $type;
?>
text/x-c++; charset=us-ascii
Array
(
[0] => text/x-c++
[1] => charset=us-ascii
)
text/x-c++
----
Server IP: 87.124.64.96
Probable Submitter: 82.11.209.1
----
Manual Page -- http://www.php.net/manual/en/ref.fileinfo.php
Edit -- https://master.php.net/note/edit/75597
Del: integrated -- https://master.php.net/note/delete/75597/integrated
Del: useless -- https://master.php.net/note/delete/75597/useless
Del: bad code -- https://master.php.net/note/delete/75597/bad+code
Del: spam -- https://master.php.net/note/delete/75597/spam
Del: non-english -- https://master.php.net/note/delete/75597/non-english
Del: in docs -- https://master.php.net/note/delete/75597/in+docs
Del: other reasons-- https://master.php.net/note/delete/75597
Reject -- https://master.php.net/note/reject/75597
Search -- https://master.php.net/manage/user-notes.php