Is there a way in PHP to name my specifiers like in Python?
I want this in PHP:
$foo = array(\'name\' => 24); printf(\"%(name)d\", $foo);
the closer core function is vsprintf() to use an array instead of multiple parameter, but you still have to use numbered parameters.
vsprintf()
in the comments of this function docs there is someone who created a function to do what you want vnsprintf() printf+array+named parameters