You are here: RE: [PHP] printf() in a variable, or alternative to printf() - SOLVED « PHP « IT news, forums, messages
RE: [PHP] printf() in a variable, or alternative to printf() - SOLVED

Posted by "mayo" on 05/28/05 07:11

Thx,

It's amazing how sleep helps. Couldn't believe that when I read
sprintf() I didn't see how it did exactly what I was looking for.

Thx all

mayo

-----Original Message-----
From: mayo [mailto:mayo@nycinteractive.com]
Sent: Thursday, May 26, 2005 11:35 PM
To: php-general@lists.php.net
Subject: [PHP] printf() in a variable, or alternative to printf()

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.

Thx for any hints.

mayo

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация