Ok on this page look under the description if you post a lot of text with no spaces it will stretch the layout but if you put spaces in the middle of that the it will wrap automaticly is there a way to force a space after like 75 characters?
Sure, substr to break it up and strpos to check if there's a space already in there.
Originally posted by mtmosier Sure, substr to break it up and strpos to check if there's a space already in there.
i have read over the substr but i dont get how to set it to a certain character length
From the example in the manual
echo substr('abcdef', 0, 4); // abcd
You give it the string, tell it to start at 0 typically, and the third option is the limit. Just imagine it with much longer strings.
Originally posted by mtmosier From the example in the manual echo substr('abcdef', 0, 4); // abcd You give it the string, tell it to start at 0 typically, and the third option is the limit. Just imagine it with much longer strings. [/B]
Originally posted by mtmosier From the example in the manual
You give it the string, tell it to start at 0 typically, and the third option is the limit. Just imagine it with much longer strings. [/B]
so users can put 1000 characters do i have to do put like
echo substr($description, 0, 75); echo substr($description, 75, 150); echo substr($description, 150, 225);
and so on?
Or you could just use wordwrap() The manual says it all 🙂