note 75650 added to function.header

From: Date: Sun, 10 Jun 2007 19:11:57 +0000
Subject: note 75650 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-127362@lists.php.net to get a copy of this message
This is a good function to send an image to the browser having the path. function PE_img_by_path($PE_imgpath = "") { if (file_exists($PE_imgpath)) { $PE_imgarray = pathinfo($PE_imgpath); $iconcontent = file_get_contents($PE_imgpath); header("Content-type: image/" . $PE_imgarray["extension"]); header('Content-length: ' . strlen($iconcontent)); echo $iconcontent; die(0); } return false; } ---- Server IP: 213.92.11.19 Probable Submitter: 62.152.110.67 ---- Manual Page -- http://www.php.net/manual/en/function.header.php Edit -- https://master.php.net/note/edit/75650 Del: integrated -- https://master.php.net/note/delete/75650/integrated Del: useless -- https://master.php.net/note/delete/75650/useless Del: bad code -- https://master.php.net/note/delete/75650/bad+code Del: spam -- https://master.php.net/note/delete/75650/spam Del: non-english -- https://master.php.net/note/delete/75650/non-english Del: in docs -- https://master.php.net/note/delete/75650/in+docs Del: other reasons-- https://master.php.net/note/delete/75650 Reject -- https://master.php.net/note/reject/75650 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#127362) next »