So I'm developing a webapp, it reads results from a MySQL db, formats them into a string, publishes this as xml which is then sent via sms message. However the results need to be divided up so that sentences arent split across text messages - so my code adds x amount of underscore characters after a series of sentences in order to fill up the remaining 140 characters of a sms message (which then allows the next sentences to begin at the start of the next message).
So its sort of like "Sentence 1. Sentence 2 is long_____________________Sentence 3. Sentence 4. Sentence 5.______" (except across 140 characters). As produced by:
Code: Select all
$q = 0;
while ($q <= $tofill)
{
$blank3 = $blank3 . "_";
$q=$q+1;
}"$blank3 = $blank3 . "_";"
to
$blank3 = $blank3 . " ";
the spaces are collapsed, so instead of 16 underscores I get a single space. Is this just a stupid oversight on my behalf? Surely there is a way of putting multiple spaces into a string....?