svn: /phpdoc/en/trunk/reference/strings/functions/ sprintf.xml

From: Date: Tue, 05 Apr 2011 10:35:31 +0000
Subject: svn: /phpdoc/en/trunk/reference/strings/functions/ sprintf.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-7923@lists.php.net to get a copy of this message
shein Tue, 05 Apr 2011 10:35:31 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=309965 Log: Added variable definitions in order to make example easy runnable. Changed paths: U phpdoc/en/trunk/reference/strings/functions/sprintf.xml Modified: phpdoc/en/trunk/reference/strings/functions/sprintf.xml =================================================================== --- phpdoc/en/trunk/reference/strings/functions/sprintf.xml 2011-04-05 10:32:58 UTC (rev 309964) +++ phpdoc/en/trunk/reference/strings/functions/sprintf.xml 2011-04-05 10:35:31 UTC (rev 309965) @@ -169,13 +169,16 @@ <programlisting role="php"> <![CDATA[ <?php +$num = 5; +$location = 'tree'; + $format = 'There are %d monkeys in the %s'; printf($format, $num, $location); ?> ]]> </programlisting> </example> - This might output, "There are 5 monkeys in the tree". But + This will output "There are 5 monkeys in the tree". But imagine we are creating a format string in a separate file, commonly because we would like to internationalize it and we rewrite it as:

« previous php.doc.cvs (#7923) next »