Try Str_len and str_pad

Regards

Chris

-----Original Message-----
From: Chris Grigor [mailto:[EMAIL PROTECTED]
Sent: 25 September 2003 13:10
To: php
Subject: [PHP] Am stuck 


Good day all

I have a txt file that has values from various strings written to it.

What Im looking for is the following

$name = "Chris';

I need to do a count on $name so that it returns 5 letters. Then before
writing it to the output file I
know that it has to be 40 charecters long before it gets written.

So I know its 5 now I need automatically add another 35 empty spaces to it
to make it 40 so that it makes the 
$name like this 

$name = "Chris                                        ";   <---- if I do a
count on this it should be 40 charecters long....


Can anyone help out here???

Chris
 
If you are not the intended recipient of this e-mail, please preserve the
confidentiality of it and advise the sender immediately of any error in
transmission. Any disclosure, copying, distribution or action taken, or
omitted to be taken, by an unauthorised recipient in reliance upon the
contents of this e-mail is prohibited. Somerfield cannot accept liability
for any damage which you may sustain as a result of software viruses so
please carry out your own virus checks before opening an attachment. In
replying to this e-mail you are granting the right for that reply to be
forwarded to any other individual within the business and also to be read by
others. Any views expressed by an individual within this message do not
necessarily reflect the views of Somerfield.  Somerfield reserves the right
to intercept, monitor and record communications for lawful business
purposes.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to