note 95428 deleted from function.sprintf by danbrown

From: Date: Sun, 03 Jan 2010 01:31:11 +0000
Subject: note 95428 deleted from function.sprintf by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-164552@lists.php.net to get a copy of this message
Note Submitter: Anonymous ---- The explanation on this page is incorrect Examples 3 and 4 are false %1$s is not valid, the correct syntax is %1\$s Examples corrected Example #3 Argument swapping <?php $format = 'The %2\$s contains %1\$d monkeys'; printf($format, $num, $location); ?> Example #4 Argument swapping <?php $format = 'The %\2$s contains %1\$d monkeys. That\'s a nice %2\$s full of %1\$d monkeys.'; printf($format, $num, $location); ?>

« previous php.notes (#164552) next »