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);
Use strtr:
$foo = array('%name%' => 24); strtr("%name%", $foo); // 24
You could also do this:
"${foo['name']}"
Or this:
$name = 24; "$name"