PHP code example of dirtyscript / flatdb

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

    

dirtyscript / flatdb example snippets


/**
 * DSDB - Dirty Script Data Base
 * 
 * a flat file basic data base
 * manage datas by key(id)
 * 
 * PHP version 5.3
 * 
 * @author     RemRem <[email protected]>
 * @copyright  2014-2016
 * @licence    MIT
 * @link       http://dirty-script.com/Data-Base
 * @link       https://github.com/DirtyScript/FlatDB
 */



use DirtyScript\FlatDB;

$your_db = new FlatDB( '/var/www/database/db-name' , true );

$your_db->data_push('you-key','This is your data');

$your_db->data_push('key','datas',true);

$your_db->data_push(null,'datas');

$your_data = $your_db->data_get('key');

$your_keys = $your_db->data_keys();

$your_db->data_remove('key');

$your_db->db_reset();

$your_db->db_read();

$your_db->db_infos();

$your_db->db_export( $format );

$you_db->db_backup( $backup_name );

$your_db->data_get_last_line( 3 );

$your_db->data_search( $test, $limit );