PHP code example of piffall / phramework

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

    

piffall / phramework example snippets




use PHK\Curl as Curl;

// New instance
$c = new Curl();

// GET
$c->setUrl('http://yourdomain.net');
$c->get();

// POST
$c->setUrl('http://yourdomain.net/action/');
$c->setDataFields(array('username'=>'user', 'password'=>'*****'));
$c->post();

// Result
$html = $c->getLastReturn();

// Reset Object
$c->reset();

// POST Multipart
$c->setUrl('http://yourdomain.net/action/');
$c->setDataFields(array('username'=>'user', 'password'=>'*****'), true);

// Errors
$err_no = $c->getErrorNumber();
$err_str = $c->getErrorString();
bash
# Install composer if is not installed
curl -sS https://getcomposer.org/installer | php

# Install phramework using composer
php composer.phar