How to view pictures in php?
Declare the read-write file as an image
Open the image as a read-write file
Adding b after r is suitable for binary files, and pictures also have better portability
##Read the picture closing handleOutput picture contentBecause it is a picture, add header('content-type:image/jpeg ');The preview effect is as shownAttached is the source codeCopy after login
##header('content-type:image/jpeg');
For more PHP knowledge, please visit PHP Chinese website!
The above is the detailed content of How to view pictures in php. For more information, please follow other related articles on the PHP Chinese website!