PHP code example of five-say / data-bag
1. Go to this page and download the library: Download five-say/data-bag 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/ */
five-say / data-bag example snippets
use FiveSay\DataBag\DataBag;
// 设置
DataBag::set('test', 666);
// 获取指定数据
$test = DataBag::get('test');
// 获取全部数据
$all = DataBag::all();
// 获取全部历史记录
$history = DataBag::history();
// 获取指定数据的历史记录
$testHistory = DataBag::history('test');
// 测试输出
var_dump($test);
var_dump($all);
var_dump($history);
var_dump($testHistory);
die;