note 99102 modified in function.imagegif by danbrown

From: Date: Fri, 30 Jul 2010 16:40:08 +0000
Subject: note 99102 modified in function.imagegif by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-171260@lists.php.net to get a copy of this message
It should be noted that if you only want to "save" the file, and not display it to the browser, you should catch the imagegif into a variable. Example: <?php //Only saves the file to a destination, no display $image_value = imagegif($image, $save_file_to_path); //Saves file and attempts to display it, but will throw an error message imagegif($image, $save_file_to_path); //Only displays, never saves as a file imagegif($image); //Note: In [my] third example, for displaying only, it is probably good to use the "header('Content-type: image/gif'); declaration, but it's not needed in the first example for saving as a .gif file. ?> --was-- It should be noted that if you only want to "save" the file, and not display it to the browser, you should catch the imagegif into a variable. Example: //Only saves the file to a destination, no display $image_value = imagegif($image, $save_file_to_path); //Saves file and attempts to display it, but will throw an error message imagegif($image, $save_file_to_path); //Only displays, never saves as a file imagegif($image); //Note: In the third example, for displaying only, it is probably good to use the "header('Content-type: image/gif'); declaration, but it's not needed in the first example for saving as a .gif file. http://php.net/manual/en/function.imagegif.php

« previous php.notes (#171260) next »