i was wondering if there was a way to tie strlen with substr to ensure a string i pass to a function is always the same length - padding out with spaces if necessary.
eg, if i needed the string 6 characters long
'doggy' becomes 'doggy ' (1 spaces on the end)
'elephant' becomes 'eleph…' (the last character is the horiz. ellipsis)
basically im outputting some database data into <pre> tags, and if i can do this, itd be brilliant, as i could easily line stuff up just using spaces.
yes, there is better things than pre tags, but thats what i have to use, so thats that.
iv had a look, but couldnt come up with anything....
itd just be so damned helpful if there was something easy...