Skip to content

Instantly share code, notes, and snippets.

@oppara
Created April 26, 2009 16:23
Show Gist options
  • Save oppara/102085 to your computer and use it in GitHub Desktop.
Save oppara/102085 to your computer and use it in GitHub Desktop.
php: sprintf use array
/**
* sprintf use array
*
* @see http://jp.php.net/manual/ja/function.printf.php
* @param string $format
* @param array $arr
* @access public
* @return string
*/
function sprintf_array( $format, $arr ) {
return call_user_func_array( 'sprintf', array_merge( (array) $format, $arr ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment