I have created an image by copying a number of images into a new one. In the last step of my program, I am trying to export this file into a folder.
The code is as
file_put_contents as per PHP manual takes the second argument a string. An image file is not a string. See the two other answeres above. That is how you save images. Try using the manual a bit more.