I use the following with no problems
$bob = "a string";
printf("%-15s",$bob);
to print the following (padded to 15 characters):
"a string_ _ _ _ _ _ _"
However, I'm having trouble locating the attribute that would truncate the string. I have a field that I simply want to print on a page that is *limited* to x number of characters and was trying to use printf.
Example:
$bob = "a really long string and I only want part of it";
would return:
"a really long stri";
$bob = "a string";
printf("%-15s",$bob);
to print the following (padded to 15 characters):
"a string_ _ _ _ _ _ _"
However, I'm having trouble locating the attribute that would truncate the string. I have a field that I simply want to print on a page that is *limited* to x number of characters and was trying to use printf.
Example:
$bob = "a really long string and I only want part of it";
would return:
"a really long stri";