Jump to content


Photo

Looking for a rtrim opposite function


  • Please log in to reply
2 replies to this topic

#1 rantsh

rantsh
  • Members
  • PipPipPip
  • Advanced Member
  • 115 posts

Posted 21 June 2006 - 11:33 PM

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
Roderick Smith.
Vivophone.com.
Get a free VIVOphone account with 30 prepaid minutes to call anywhere in the US (or some minutes to other places) by going to http://www.vivophone...hp?promo=SR0979

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 21 June 2006 - 11:40 PM

[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.

#3 rantsh

rantsh
  • Members
  • PipPipPip
  • Advanced Member
  • 115 posts

Posted 21 June 2006 - 11:56 PM

[!--quoteo(post=386639:date=Jun 21 2006, 07:40 PM:name=thorpe)--][div class=\'quotetop\']QUOTE(thorpe @ Jun 21 2006, 07:40 PM) View Post[/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
Roderick Smith.
Vivophone.com.
Get a free VIVOphone account with 30 prepaid minutes to call anywhere in the US (or some minutes to other places) by going to http://www.vivophone...hp?promo=SR0979




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users