PHP code example of selcukmart / data-store-library-y42
1. Go to this page and download the library: Download selcukmart/data-store-library-y42 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/ */
selcukmart / data-store-library-y42 example snippets
$storage = $_SESSION['DataStoreLibrary'];
$storage_factory = SessionFactory::create($storage);
$batch_insert_array = [
'Contrary to popular belief, Lorem Ipsum is not simply random text.',
'Lorem Ipsum is simply dummy text of the printing and typesetting',
'There are many variations of passages of Lorem Ipsum available',
'It is a long established fact that a reader will be distracted by the',
];
$results = $storage_factory->insertBatch($batch_insert_array);
$storage = $_SESSION['DataStoreLibrary'];
$storage_factory = SessionFactory::create($storage);
$str = 'Contrary to popular belief, Lorem Ipsum is not simply random text.';
$str2 = 'Lorem Ipsum is simply dummy text of the printing and typesetting';
$str3 = 'There are many variations of passages of Lorem Ipsum available';
$str4 = 'It is a long established fact that a reader will be distracted by the';
$storage_factory->insert($str);
$storage_factory->insert($str2);
$storage_factory->insert($str3);
$storage_factory->insert($str4);
$results = $storage_factory->filter($str3);
echo $results[0]->getHash();
echo $results[0]->getItem();
$storage = $_SESSION['DataStoreLibrary'];
$storage_factory = SessionFactory::create($storage);
$batch_insert_array = [
'Contrary to popular belief, Lorem Ipsum is not simply random text.',
'Lorem Ipsum is simply dummy text of the printing and typesetting',
'There are many variations of passages of Lorem Ipsum available',
'It is a long established fact that a reader will be distracted by the',
];
$results = $storage_factory->insertBatch($batch_insert_array);
$result = $storage_factory->lists(limit: 2, offset: 2);