note 111813 deleted from function.sprintf by aharvey
| From: | aharvey@php.net | Date: | Thu, 04 Apr 2013 03:37:00 +0000 |
| Subject: | note 111813 deleted from function.sprintf by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-194320@lists.php.net to get a copy of this message | ||
Note Submitter: K.Alex
----
Sometimes you may also need to print % sign, if you should put message like "Your have to
finish 50% of tasks" lets say on different languages.
Percent should be seplaced with %s marker, or else you will loose next letter instead.
<?php
define(FINISH_MESSAGE, 'Your have to finish %d%s of tasks');
echo sprintf(FINISH_MESSAGE, $_SESSION['percent'],'%').'</p>';
// Your have to finish 50% of tasks
?>