v0.9.8 2023-02-07 20:23 UTC

This package is auto-updated.

Last update: 2024-04-07 22:41:07 UTC


My php string parser library provides an abstract mechanism to tokenize, parse and until compile any kind of scripts you want.
There are some implemented parsers ready to use for expressions.

$parser = new SimpleTokenParser();
print_r($parser->parseString("12 + 13 / 6"));

This list all parsed tokens.
Token parsing is done by php token_get_all function, but you can easy subclass a tokenizer to customize string tokenizing.


PHP String Parser is a composer package. So you can simply install it by

$ composer require tasoft/php-string-parser

Now the library is available under namespace \TASoft\Parser...


The package tasoft/predicate uses this parser to create predicates from string.