Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php response image

<?php
$name = './img/ok.png';
$fp = fopen($name, 'rb');

header("Content-Type: image/png");
header("Content-Length: " . filesize($name));

fpassthru($fp);
Comment

php response image

<?php
// open the file in a binary mode
$name = './img/ok.png';
$fp = fopen($name, 'rb');

// send the right headers
header("Content-Type: image/png");
header("Content-Length: " . filesize($name));

// dump the picture and stop the script
fpassthru($fp);
exit;
?>
Comment

PREVIOUS NEXT
Code Example
Php :: php get youtube code 
Php :: mysql gone away error in php 
Php :: post rest drupal 
Php :: array map php 
Php :: laravel "query()-find" 
Php :: php-array-delete-by-value-not-key 
Php :: PHP substr_replace — Replace text within a portion of a string 
Php :: how to use concat in laravel 
Php :: add javascript to wordpress functions php 
Php :: laravel crud application 
Php :: Publish Spatie Laravel Permission 
Php :: php wait for exec to finish 
Php :: magento show which user updated the product 
Php :: enable phpmailer cpanel 
Php :: php online test 
Php :: get data from stdclass object php 
Php :: array_search function in php 
Php :: package manifest php error 
Php :: remove array values php 
Php :: laravel collection only 
Php :: merge pdf php fpdf 
Php :: API json data show in laravel 
Php :: run laravel without php artisan serve 
Php :: php increment variable by 1 
Php :: php html text before first h2 tag 
Php :: merge multiple exceptions php 
Php :: elvis operator php 
Php :: utf8mb4 decode in php 
Php :: how to add accept and decline button in php form 
Php :: redirect www to non-www wordpress multisite 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =