rantsh Posted June 21, 2006 Share Posted June 21, 2006 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 123456Record BLABLA 32Rec 2 999999Thanks for the help, Roderick SmithFrom Venezuela Link to comment https://forums.phpfreaks.com/topic/12596-looking-for-a-rtrim-opposite-function/ Share on other sites More sharing options...
trq Posted June 21, 2006 Share Posted June 21, 2006 [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. Link to comment https://forums.phpfreaks.com/topic/12596-looking-for-a-rtrim-opposite-function/#findComment-48275 Share on other sites More sharing options...
rantsh Posted June 21, 2006 Author Share Posted June 21, 2006 [!--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 Link to comment https://forums.phpfreaks.com/topic/12596-looking-for-a-rtrim-opposite-function/#findComment-48286 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.