PHP code example of goldofficer / imagekiller

1. Go to this page and download the library: Download goldofficer/imagekiller library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

goldofficer / imagekiller example snippets



use GoldOfficer\ImageKiller;

$localImage = ImageKiller::saveImage(
    'https://img.oasgames.com/upload/1527673136/web/images/indexbg.jpg',
    null,
    '/tmp',
    '.jpg'
);

var_dump($localImage);
//
// array(3) {
//   ["conentType"]=>
//   array(1) {
//     [0]=>
//     string(10) "image/jpeg"
//   }
//   ["imageSize"]=>
//   array(1) {
//     [0]=>
//     string(5) "24521"
//   }
//   ["localImagePath"]=>
//   string(78) "/tmp/e99a0580-6f92-11e8-a4ec-00005b21fb8c-e53e6df2-02e4-4a58-bf8b-3347a439e361"
// }
//