Why dont you trim the string first to ensure that there are no empty spaces at the end and beginning of it http://ca3.php.net/manual/en/function.trim.php
and then do your count. Chris <-- SNIP --> 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 <-- SNIP --> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php