note 23369 deleted from function.sprintf by derick
| From: | derick@php.net | Date: | Tue, 16 Mar 2004 10:47:21 +0000 |
| Subject: | note 23369 deleted from function.sprintf by derick | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-66898@lists.php.net to get a copy of this message | ||
Note Submitter:
----
You can't use sprintf() to put items in an array, at least not directly.
$myarr = array(sprintf("%-40s", $somevar));
ought to put $somevar left-justified in 40 spaces, into the array. Instead you get a parse error:
unexpected T_ENCAPSED_AND_WHITESPACE. Apparently the 's' in sprintf doesn't actually
stand for 'string,' because that's not what sprintf is returning here. Too bad.