1. Go to this page and download the library: Download jdz/data 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/ */
jdz / data example snippets
use JDZ\Utils\Data;
$data = new Data();
// Set values using dot notation
$data->set('user.name', 'John Doe');
$data->set('user.email', '[email protected]');
$data->set('user.settings.theme', 'dark');
// Get values
echo $data->get('user.name'); // "John Doe"
echo $data->get('user.age', 30); // 30 (default value)
// Check existence
if ($data->has('user.email')) {
echo "Email exists!";
}
// Work with arrays
$data->set('users.0.name', 'John');
$data->set('users.1.name', 'Jane');
// Get typed values
$isActive = $data->getBool('user.active', true);
$count = $data->getInt('user.login_count', 0);
$tags = $data->getArray('user.tags', []);