How to echo text in browser instead of download junk file? July 5, 2022 by Tarik Billa This change is untested: if( $file === '' || ! isset( $file ) || ! file_exists( $file ) ) {