1. Go to this page and download the library: Download fi1a/tokenizer 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/ */
fi1a / tokenizer example snippets
use Fi1a\Tokenizer\ConsoleLine\Tokenizer;
use Fi1a\Tokenizer\ITokenizer;
$tokenizer = new Tokenizer('info --locale="ru , en"');
while (($token = $tokenizer->next()) !== ITokenizer::T_EOF) {
$token->getImage(); // 'info', ' ', '--locale', '=', '"', 'ru , en', '"'
}
use Fi1a\Tokenizer\CSS3Selector\Tokenizer;
use Fi1a\Tokenizer\ITokenizer;
$tokenizer = new Tokenizer('div.e-class1.m_class2 .b-class3');
while (($token = $tokenizer->next()) !== ITokenizer::T_EOF) {
$token->getImage(); // 'div', '.e-class1', '.m_class2', ' ', '.b-class3'
}
use Fi1a\Tokenizer\PHP\TokenizerFactory;
use Fi1a\Tokenizer\ITokenizer;
$tokenizer = TokenizerFactory::factory(" class Foo {}");
while (($token = $tokenizer->next()) !== ITokenizer::T_EOF) {
$token->getImage(); // ' ', 'class', ' ', 'Foo', ' ', '{', '}'
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.