Location: PHPKode > scripts > CSS sprite class > examples/download_sprite_example.php

 * This example shows how to save CSS sprite to specified location or force to download it
//declaring class instance
$sprite = new spritify();

//adding test images
$sprite->add_image("../test_images/php.jpg", "jpeg");
$sprite->add_image("../test_images/php.gif", "gif");
$sprite->add_image("../test_images/elephpant.png", "elephant");

//retrieving error
$arr = $sprite->get_errors();
//if there are any then output them
	foreach($arr as $error)
		echo "<p>".$error."</p>";
	//saves file in provided path 
	//in this example it is in the same folder with file name file.png
	//forces file download in browser window
Return current item: CSS sprite class