Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Neet to make text variables a specific length (fixed-width) 1

Status
Not open for further replies.
Feb 20, 2002
64
US
Is there a function in PHP that will take a variable and add space after it to make it a specific length. In other words:

$example1 = "cow";
$example2 = "google";
echo "$example1$example2!!";

Output:
cowgoogle!!

Where as I would like to:

$example1 = fake_string_length_function($example1, 10);
$example2 = fake_string_length_function($example2, 10);
echo "$example1$example2!!";

Output:
cow google !!

^
12345678901234567890

 
I really wish you could edit posts after they've been posted. I just noticed my silly little subject line. "Neet" should be "Need"

:: sigh :: [shadessad]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top