S
S
Senseich2018-03-25 01:52:37
PHP
Senseich, 2018-03-25 01:52:37

Does PHP have a function to open a file on a PC?

Purely, for the sake of interest, is there such a function that opens the file specified on the PC in the window?
I know that you can open it through the command line: $path = ` Путь к файлу `;but I didn’t find such a function)
Is there such a thing in nature?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
index0h, 2018-03-25
@index0h

Are you aware that php is a server language and does not interact with the GUI + `something` - do not open a file?
Read on fopen + file_get_contents

B
bro-dev, 2018-03-25
@bro-dev

exec(mspaint);
This is how it worked for me, that is, accessing a page with such code via the web opened a paint window on the server. If you also need the axis to determine how to open the file, then I think you can also dig and find it.

E
Ernest Faizullin, 2018-03-25
@erniesto77

return header('Content-Type: '<формат файла>');
example file formats need to be googled, but it works something like this

M
Monty Python, 2018-03-25
@Austin1

There is such a thing as MIME (Internet Media Types)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question