1. Go to this page and download the library: Download fabiomez/data-extractor 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/ */
class MyModel
{
/**
* @extractable
* {@start 0}
* {@length 10}
* @otherTag from prop 1
*/
public $prop1;
/**
* @extractable
* {@start 10}
* {@length 11}
* @otherTag from prop 2
*/
public $prop2;
}
use Fabiomez\DataExtractor\Extractor;
use Fabiomez\DataExtractor\DocBlockParser;
use Fabiomez\DataExtractor\ValueGetters\ArrayValueGetter;
use Fabiomez\DataExtractor\ValueGetters\RegexValueGetter;
use Fabiomez\DataExtractor\ValueGetters\SubstringValueGetter;
//Array extractor
$extractor = new Extractor(
DocBlockParser::createInstance(),
new ArrayValueGetter()
);
//Regex extractor
$extractor = new Extractor(
DocBlockParser::createInstance(),
new RegexValueGetter()
);
//Substring extractor
$extractor = new Extractor(
DocBlockParser::createInstance(),
new SubstringValueGetter()
);