MIME_Type
[ class tree: MIME_Type ] [ index: MIME_Type ] [ all elements ]

Source for file example.php

Documentation is available at example.php

  1. <?php
  2.  
  3. require_once 'MIME/Type.php';
  4.  
  5. $type 'application/x-test-app; foo="bar" (First argument); bar=baz (Second argument)';
  6. $type2 'application/vnd.pear.test-type';
  7.  
  8. print "Checking type: $type\n";
  9. if (MIME_Type::isExperimental($type)) {
  10.     print "Type is experimental\n";
  11. else {
  12.     print "Type is not experimental\n";
  13. }
  14.  
  15. print "\nChecking type: $type2\n";
  16. if (MIME_Type::isVendor($type2)) {
  17.     print "Type is vendor-specific\n";
  18. else {
  19.     print "Type is not vendor-specific\n";
  20. }
  21.  
  22. $file '@doc_dir@/MIME_Type/example.php';
  23. print "\nChecking type of: $file\n";
  24. $type MIME_Type::autoDetect($file);
  25. if (PEAR::isError($type)) {
  26.     print 'Error: ' $type->getMessage("\n";
  27. else {
  28.     print $type "\n";
  29. }
  30.  
  31. ?>

Documentation generated on Mon, 11 Mar 2019 16:03:55 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.