Skip to content
Advertisement

Tag: string.format

vsprintf or sprintf with named arguments, or simple template parsing in PHP

I’m searching for a way to use named arguments for sprintf or printf. Example: or via vsprintf and an associative array. I have found some coding examples here http://php.net/manual/de/function.sprintf.php and here http://php.net/manual/de/function.vsprintf.php where people wrote their own solutions. But my question is, is there maybe an standard PHP solution out there to achieve this or is there another way, maybe

Advertisement