1. Go to this page and download the library: Download marcojetson/tummy 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/ */
marcojetson / tummy example snippets
$formats = (new Tummy\Config\Factory())->create([
'format1' => [
'ident' => new Tummy\Record\Ident\Match('NEW'), // used for supporting multiple record formats in a single file
'elements' => [
[
'length' => 3,
'reference' => 'type',
' [
'length' => 8,
'reference' => 'birthday',
'converter' => new Tummy\Record\Element\Converter\DateTime('dmY'),
],
],
],
'format2' => [
'ident' => new Tummy\Record\Ident\Match('PWD'),
'recordClass' => PwdRecord::class, // will use \stdClass if not specified
'elements' => [
[
'length' => 3,
'reference' => 'type',
],
[
'length' => 1,
],
[
'length' => 16,
'reference' => 'username',
],
[
'length' => 16,
'reference' => 'password',
],
],
],
]);