try { $parserBuilder = (new ParserBuilder()) ->setTransportClass(FromTextTransport::class) ->setStorageClass(TagStorage::class) ->setProcessorClass(TagCounterProcessor::class) ->setParserClass(TagCounterParser::class); $parser = $parserBuilder->build(); $resultData = $parser->parse(new TextSource("<br><p></p><p>")); $result = new ParseResultFormatter($resultData); print_r($result->getAsArray()); } catch (TransportException $th) { } catch (ParseException $th) { }
See Example\TagCounterExample.php for complete example.