PHP code example of zguillez / php-tools

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

    

zguillez / php-tools example snippets


$data  = ['nombre' => 'test', 'apellidos' => 'test', 'email' => '[email protected]'];
$result = $tools->get('https://dummy.webservice.com/json', $data, true);
$tools->test($result);

$data  = ['nombre' => 'test', 'apellidos' => 'test', 'email' => '[email protected]'];
$result = $tools->post('https://dummy.webservice.com/json', $data, true);
$tools->test($result);

$db = $tools->database('***.***.***.***', 'user', '********', 'database');
$db->sql('INSERT INTO dummy_table SET value=1']);
leadid = $db->sql2lead('INSERT INTO dummy_table SET value=1']);
$tools->test($result);

$data = $tools->sql2array('SELECT * FROM dummy_table');
$tools->excel('test', $data, ['id', 'value', 'created_at'], true);