Calling the system to open a file in PHP

How do one go about opening a file in php by using the resources made available on a system.
Take for instance that after getting the header content information of a file, one discovers that the file is a word document, or a pdf file, how do one use a php available functions to get to alert the system to open the file based on the type of file you are dealing with?

Can you elaborate on exactly what you’re trying to do? Is this part of a file upload procedure, for example, or are you using PHP to retrieve content from other locations, then need to do something with that content once it’s arrived?

too lazy to re-type it

Its actually part of a file upload procedure that I am working on, My boss who is actually an expert at working with .NET framework, wants me to do some things in PHP which are readily available in Visual Studio for .NET programmers and this has been challenging for a fresher in PHP development like me. It was in carrying out some of his tasks that I saw the need for JavaScript knowledge, because ordinarily PHP had no ability to handle client-side events.