Jump to content

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
Link to comment
https://forums.phpfreaks.com/topic/12596-looking-for-a-rtrim-opposite-function/
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.
[!--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
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.