Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
problem with wordwrap!
Old 12-13-2007, 10:33 AM problem with wordwrap!
Average Talker

Posts: 20
Trades: 0
Hello,

What I'm trying to do here is show a URL to the user, however since it's actually one big 'word', in most browsers it falls out of the div. So that's why I tried PHP wordwrap, and setting the width to something like 70 does the job.

Quote:
$str = wordwrap($str, 70, "<br>\n", true);
HOWEVER I noticed that large characters like 'W' etc. fall out because they are bigger in Arial, so I think PHP counts the chars or something like that, because when I input 50 dots it cuts real soon (for the eye), and when I input 50 'W's (or other big characters) a huge chunk falls out of the div. I just want a static width, either with wordwrap or with something else (php/html), I'm open for suggestions.

Thank you.
koolaid is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-14-2007, 02:22 AM Re: problem with wordwrap!
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Use fixed width font like Courier New
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 01-21-2008, 09:36 PM Re: problem with wordwrap!
carloncho's Avatar
Skilled Talker

Posts: 80
Name: Carlos
Trades: 0
Yes, with fixed fonts, you dont have that problem. Anyway, that is a bug of wordwrap function.
__________________
-----------------------

Please login or register to view this content. Registration is FREE
carloncho is offline
Reply With Quote
View Public Profile Visit carloncho's homepage!
 
Reply     « Reply to problem with wordwrap!
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.17547 seconds with 12 queries