Skip to content
Advertisement

Restore content file_get_content() function

I gave an image as a parameter to the file_get_content() function and received it as the output of a string. Now I want to do the opposite of this operation. What should I do?

Advertisement

Answer

You can write it back to an image file using file_put_contents

Example:

JavaScript

If you then look into your folder “images/”, there should be a new file called “test-new.png”

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement