I have some text in a block with a certain width. I can count the number of lines in the text with substr($text,"<br />" but this is not the same with the number of line of the formatted text at that width. Is there a way to calculate that? Thank you.
Jump to Post
You could get an approximate answer by dividing the number of characters in the text by the average number of characters per line in a block of the given width. It won't be perfectly accurate, but unless the block is very narrow, you will be right a good deal of …
All 2 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.