ID:               6893
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
 Status:           Assigned
 Bug Type:         Feature/Change Request
 Operating System: N/A
 PHP Version:      4.0.2
 Assigned To:      tal
 New Comment:

How about posting a link to this source online?


Previous Comments:
------------------------------------------------------------------------

[2003-01-21 14:23:19] [EMAIL PROTECTED]

I developed such a function in php with extensive exceptions checking,
some months ago.

If it would help you, you might like to eyeball it. It may give you
valuable and time-saving clues to coding it as a C++ function.

Please send me an email address to deliver you part of my script
library as an attachment.

------------------------------------------------------------------------

[2002-04-28 13:35:01] [EMAIL PROTECTED]

dealing with trailing periods and commas on urls is pretty easy -- just
ignore them if they're followed by a whitespace character. (it's not
100% reliable, of course, but in my experience is more often correct
than including the trailing period or comma in that case.)

------------------------------------------------------------------------

[2002-04-28 06:57:19] [EMAIL PROTECTED]

In playing with this kind of thing in the past I've come up against the
following problem: How do you handle URLs embedded in sentences which
have contact with a full stop or commas?

"Have a look at www.examples.com/hi.html, it might help you out"

Baring in mind that some sites DO include a comma in the URL, for
example any site powered by the Vignette content managment system -
example:

http://www.vignette.com/CDA/Site/0,2097,1-1-1489,00.html

The same goes for sentences where the URL is followed directly by a
full stop.

The other thing that might be worth taking in to consideration is that
many site designs will "break" if suitably long URLs are added (this is
especially true for forums, which will be a major use for this
function). The  best solution I have seen is vBulletin's, where long
URLs are shortened to look like this:

http://example.com/lon...blah.html

Where the full URL (to which the above text is linked) looks like
this:

http://example.com/long-url-here/blah/blah/blah.html

Obviously different sites would need different lengths of URL, so
whether or not URLs were shortened like this (and to what extent they
were shortened) should probably be specified by an optional second
paramater of some sort.

Hope that helps,

Simon

------------------------------------------------------------------------

[2002-04-28 02:24:17] [EMAIL PROTECTED]

I'm planning to write a String_Manipulation (or something similiar,
we'll probably fight about that... ;-)). Assigned to myself.

-Tal

------------------------------------------------------------------------

[2002-01-06 10:02:06] [EMAIL PROTECTED]

sounds if PEAR has another task ;). reclassified.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/6893

-- 
Edit this bug report at http://bugs.php.net/?id=6893&edit=1

Reply via email to