RE: printf() in a variable, or alternative to printf()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[snip]
I need to be able to format data.
 
Printf() is perfect because I need a certain amount of characters (30
for address). 
 
However I need this formatted data to be inside a file that's fwrite()
and then FTPed to a distributor who will parse it and input into their
database.
 
 
printf("% 4d",$orderID[0]); does not work in
 
$thisContent="
 
"data" .
"moredate" .
"evenmoredata" .
 
";
 
 
In effect I need the output of printf() to be placed inside a variable
and I don't see how to do that. Str_pad(), of course, does not work. 
[/snip]

Have you tried

$variable_name = printf("% 4d",$orderID[0]);

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux