473,508 Members | 2,180 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

wrapping a long string at 80 chars

Hey all

I'm working on creating a "send an email to a friend" page that
includes the link of a given search from a website. However, the url
of the website is really long and when displayed on the page it screws
up all of the formatting. Is there a way to force a wrap of the text?
Say each line is approx 80 characters.

I don't believe there is a simple HTML solution...wanted to see if
anyone on this forum had to do this previously and has some code to
share.

Thanks, Greg

Dec 18 '05 #1
5 1960
Greg Scharlemann wrote:
Is there a way to force a wrap of the text?


http://php.net/wordwrap

--
E. Dronkert
Dec 18 '05 #2

Ewoud Dronkert wrote:
Greg Scharlemann wrote:
Is there a way to force a wrap of the text?


http://php.net/wordwrap


Sweet. Thanks.

Dec 18 '05 #3
> > > Is there a way to force a wrap of the text?

http://php.net/wordwrap


The wordwrap function doesn't seem to work. It appears to wrap at the
next space in the string, but if I have a URL, there are no spaces and
thus no wrapping. Any other thoughts?

Dec 18 '05 #4
Greg Scharlemann wrote:
> Is there a way to force a wrap of the text?

http://php.net/wordwrap


The wordwrap function doesn't seem to work. It appears to wrap at the
next space in the string, but if I have a URL, there are no spaces and
thus no wrapping. Any other thoughts?


If you want to force a wrap on, say, an URL, just use the "cut"
parameter. See example 2 in the manual entry for wordwrap().

--
Kim André Akerĝ
- ki******@NOSPAMbetadome.com
(remove NOSPAM to contact me directly)
Dec 18 '05 #5
Greg Scharlemann wrote:
http://php.net/wordwrap


The wordwrap function doesn't seem to work. It appears to wrap at the
next space in the string, but if I have a URL, there are no spaces and
thus no wrapping. Any other thoughts?


Yeah. Read it properly.

--
E. Dronkert
Dec 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
5407
by: jagmeena | last post by:
Hello, I am sure this problem has been addressed before, however, I could'nt get a suitable solution to my problem. Hence I am posting here. Thanks a lot for all your help. The code I have is ...
2
2257
by: Exits Funnel | last post by:
Hello, I've inherited a bunch of code which was written on windows and makes frequent calls to _wtol( ) which converts a 2 byte char array to a long integer. I'm pretty sure it is a Microsoft...
11
50276
by: Colleyville Alan | last post by:
I posted that I was having trouble with a SQL statement that was working in the SQL window, but not in VBA. I have since discovered that when I create the string in VBA it is over 1023 characters...
16
5960
by: Christopher Benson-Manica | last post by:
I'm wondering about the best way to do the following: I have a string delimited by semicolons. The items delimited may be in any of the following formats: 1) 14 alphanum characters 2) 5...
9
6264
by: Durgesh Sharma | last post by:
Hi All, Pleas help me .I am a starter as far as C Language is concerned . How can i Right Trim all the white spaces of a very long (2000 chars) Charecter string ( from the Right Side ) ? or how...
44
1920
by: Patrick | last post by:
Hello I have the following "easy" problem. I have a string which contains 1000 chars. Now my task is to cut the string at his 650 position. I tried strcpy, to copy the first 650 chars into...
2
1577
by: Andrzej Kaczmarczyk | last post by:
Hi I am experiencing something weird. maybe you could help me. I have two ineditable classes from outsource libraries: DataColumn and GridColumn I have built a wrapper class around...
15
1649
by: cj | last post by:
I've got a long string to be written to a field in a sql db table via stored procedure. For some reason I find only 258 chars are being written. Any ideas? relevant bits of my VB2005 code: ...
3
4156
by: andrewkl | last post by:
hi, I have the following Perl code that inserts a string to an Oracle DB via a stored procedure: #!/usr/local/bin/perl ## Perl v5.8.6 built for sun4-solaris use strict; BEGIN...
0
7231
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7132
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7063
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3211
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1568
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
773
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
432
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.