PHP code example of anekdotes / manager

1. Go to this page and download the library: Download anekdotes/manager 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/ */

    

anekdotes / manager example snippets


use Anekdotes\Manager\Manager;

$manager = new Manager(array);
$manager->manage(Input::file('nameOfInput'));

$manager = new Manager(array);
$manager->manage($_FILES['nameOfInput']);

try {
    $manager = new Manager(array);
    $manager->manage($_FILES['nameOfInput']);
} catch (\Exception $e) {
    //do something
}

    new Manager(array());

    'prefix' => '/public',

    'path' => 'uploads/',

    'exts' => array('jpeg', 'jpg', 'png),

    'weight' => 3000000,

    'size' => array(
    ),

    $manager = new Manager(array(
        'prefix' => '/public',
        'path' => 'uploads/',
        'exts' => array('jpeg', 'jpg', 'png),
        'weight' => 3000000
    ));

    $manager->manage($_FILES['nameOfInput'], function($fi){
        //do something fancy
        return "potato.jpg";
    });