PHPackages                             donatj/printf-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. donatj/printf-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

donatj/printf-parser
====================

PHP printf-syntax compatible printf string parser. Parses printf strings into a stream of lexemes.

v0.5.0(6mo ago)461.4k↑66.7%MITPHPPHP &gt;=7.4CI passing

Since Mar 18Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/donatj/printf-parser)[ Packagist](https://packagist.org/packages/donatj/printf-parser)[ Fund](https://www.paypal.me/donatj/15)[ GitHub Sponsors](https://github.com/donatj)[ RSS](/packages/donatj-printf-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (6)Versions (11)Used By (0)

Printf Parser
=============

[](#printf-parser)

[![Latest Stable Version](https://camo.githubusercontent.com/53199aaed80f1c04654aaba0a92abf5ed1397d89bd66829a1725f5937595d20b/68747470733a2f2f706f7365722e707567782e6f72672f646f6e61746a2f7072696e74662d7061727365722f76657273696f6e)](https://packagist.org/packages/donatj/printf-parser)[![Total Downloads](https://camo.githubusercontent.com/107b1213a80f9f7ec7fd670c4df8ac1c9e46db8b90135e586c0d69e5141074c7/68747470733a2f2f706f7365722e707567782e6f72672f646f6e61746a2f7072696e74662d7061727365722f646f776e6c6f616473)](https://packagist.org/packages/donatj/printf-parser)[![License](https://camo.githubusercontent.com/17eda0b962feb5e11979cab6c054baaa58be76bc2e3c5a3725f23993c6dca48e/68747470733a2f2f706f7365722e707567782e6f72672f646f6e61746a2f7072696e74662d7061727365722f6c6963656e7365)](https://packagist.org/packages/donatj/printf-parser)[![ci.yml](https://github.com/donatj/printf-parser/actions/workflows/ci.yml/badge.svg)](https://github.com/donatj/printf-parser/actions/workflows/ci.yml)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/37431a6cedd016fc46238a5d7c1e3e0c95d01213fbd48df4a99a212eac177e30/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646f6e61746a2f7072696e74662d7061727365722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/donatj/printf-parser)[![Code Coverage](https://camo.githubusercontent.com/fe267314eded1e9d6f6080aad2173d3edf1286bf838978f12976f45f8cada61c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f646f6e61746a2f7072696e74662d7061727365722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/donatj/printf-parser)

PHP printf-syntax compatible printf string parser.

Parses printf strings into a stream of lexemes.

Requirements
------------

[](#requirements)

- **php**: &gt;=7.4

Installing
----------

[](#installing)

Install the latest version with:

```
composer require 'donatj/printf-parser'
```

Example
-------

[](#example)

Here is a simple example:

```
