Named specifier in php formatted strings, similar to Python\'s formatted strings using dictionaries


/ Published in: PHP
Save to your folder(s)

Taken from stackoverflow answer by user Jon

To test
$foo = array('age' => 5, 'name' => 'john');
echo vsprintf_named("%(name)s is %(age)02d", $foo);

URL: http://stackoverflow.com/questions/7435233/name-php-specifiers-in-printf-strings

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.