dougbnv
asked on
Count characters and add trailing spaces
Hi,
I need format a string,
$string = "this is the string"
$length = 35
If the strlen($string) is < 35 chars I need to write the string with trailing spaces to make up the required length eg:
"this is the string "
What's the best way to do this?
I need format a string,
$string = "this is the string"
$length = 35
If the strlen($string) is < 35 chars I need to write the string with trailing spaces to make up the required length eg:
"this is the string "
What's the best way to do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.