Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Mark Rolich  >  PHP lib for PunyPNG API  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: non-batch mode example
Class: PHP lib for PunyPNG API
Compress images using the PunyPNG Web service
Author: By
Last change:
Date: 2 years ago
Size: 287 bytes
 

Contents

Class file image Download
<?php
include 'PunyPNG.php';

$pp = new PunyPNG();
$pp->apiKey 'replace-with-your-api-key';
$pp->savePath 'compressed/';

$images = array(
    
'files/img1.png',
    
'files/img2.jpg',
    
'files/img3.gif'
);

$pp->compress($images);

echo 
$pp->printInfo();
echo 
$pp->printErrors();
?>