How to use Filesystem filetype in PHP

In this article I am going to explain about filetype function in PHP.
  • 1265

PHP filetype() Function

The filesystem filetype function is used to  returns the type of given file.

Syntax of filetype function

filetype(filename)

Parameters in filetype  function

It has only one parameter:

Parameter Description
filename It specifies the file to check.

Example of filesystem filetype function

<html>

<body>
 

<?php

echo "The type of the file is: ";

echo filetype("C:\wamp\www\Dinesh\Mcn.txt");

?>
 

</body>

</html>


Output:

filetypefunctionphp.jpg

You may also want to read these related articles :
here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.