i am writing a php code that displays text from a database.
how would i make the text auto break <br />
after a certain amount of chars?
please help asap. thanks
tcollins412 0 Junior Poster
Recommended Answers
Jump to PostHi
If its to format the output from the database would you not be better using css to wrap the text placed in a container??You can wrap text using php using the following
<?php $text = "The quick brown fox jumped over the lazy dog."; …
Jump to PostThe last code i gave wraps nearest word to index 20 of the string
The following code will split the line and insert the break after the 20th character<?php $text = "lets have a look how many chars before this breaks the string and inputs a …
All 7 Replies
lyrico 23 Junior Poster in Training
nuttyniall 0 Newbie Poster
rajvinoth 0 Newbie Poster
kuink 0 Newbie Poster
johnsteve.bravo 1 Light Poster
tcollins412 0 Junior Poster
nuttyniall 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.