php
This is a Word DocumentIn this example, we have used the getExtension() function to check if a file is a Word document or not. We first convert the extension to lowercase and then check if it matches either "docx" or "doc". If it does, we print that it is a Word document. Otherwise, we print that it is not. The pathinfo() function is a built-in PHP function and does not require any external package or library.