Jump to content

Archived

This topic is now archived and is closed to further replies.

rantsh

Looking for a rtrim opposite function

Recommended Posts

I have some data stored in a database, now, what I need is that when I get a string from the database if it is smaller than a given size then fill the rest with blanks. The reason is that it will be writen to a file and my boss wants it to be nicely squared out any one knows how I can achieve this?

Example output:

Record 1 123456
Record BLABLA 32
Rec 2 999999

Thanks for the help,

Roderick Smith
From Venezuela

Share this post


Link to post
Share on other sites
[a href=\"http://php.net/strpad\" target=\"_blank\"]strpad[/a]().

Actually... if your just trying to format the data for display you should use tables or css or at the very least [a href=\"http://php.net/sprintf\" target=\"_blank\"]sprintf[/a](). Don't add unneeded data to the string.

Share this post


Link to post
Share on other sites
[!--quoteo(post=386639:date=Jun 21 2006, 07:40 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 21 2006, 07:40 PM) [snapback]386639[/snapback][/div][div class=\'quotemain\'][!--quotec--]
[a href=\"http://php.net/strpad\" target=\"_blank\"]strpad[/a]().

Actually... if your just trying to format the data for display you should use tables or css or at the very least [a href=\"http://php.net/sprintf\" target=\"_blank\"]sprintf[/a](). Don't add unneeded data to the string.
[/quote]

I understand that but, you see the output goes on a plain text file, it's not meant to be shown on the browser, thanks anyway

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.