Req #9789 [Opn->Bgs]: feature request - makelinks() function
| From: | cellog@php.net | Date: | Wed, 10 Jan 2007 05:30:16 +0000 |
| Subject: | Req #9789 [Opn->Bgs]: feature request - makelinks() function | ||
| References: | 1 | Groups: | php.pear.webmaster |
| Request: | Send a blank email to pear-webmaster+get-5573@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=9789&edit=1
ID: 9789
Updated by: cellog@php.net
Reported By: pgl at instinct dot org
-Status: Open
+Status: Bogus
Type: Feature/Change Request
Package: PEPr
Operating System: All and any
PHP Version: 5.2.0
New Comment:
What you need is a simple regular expression to grab urls and then
encase them in <a href="\\1">\\1</a> using preg_replace. This is a
2-line piece of code, and so does not belong as a complete PEAR
package.
if you wish to propose a new package for PEAR that includes string
manipulation, feel free, http://pear.php.net/pepr
Previous Comments:
------------------------------------------------------------------------
[2007-01-09 17:16:36] pgl at instinct dot org
Description:
------------
Re: http://bugs.php.net/bug.php?id=6893
Last comment (from bjori@php.net) was:
"Please file PEAR/PECL related issues in the PEAR/PECL bug
tracker."
So, I am doing so. Here is the original bug report / feature request:
--8<--
I don't know if this is the best way to submit a feature request, but I
think it would be handy to have a builtin makelinks() function, to
change all urls in a piece of text to actual links. eg, changing "my
homepage is at http://www.arse.net/" to "my
homepage is at <a
href=http://www.arse.net/>http://www.arse.net/</a>".
'course, it's
pretty easy to code this yourself, but then so is nl2br(), and having
it as part of the source would (maybe?) make it faster.
--8<--
Cheers,
- Peter
PS: Apologies if this is not the correct area to submit feature
requests. It wasn't clear from http://pear.php.net/bugs/ where was the
best place.
Test script:
---------------
<?
$txt = "Hi! My homepage is at http://pgl.yoyo.org/.";
$html = makelinks($txt);
echo $html
/*
Outputs:
--8<--
Hi! My homepage is at <a
href="http://pgl.yoyo.org/">http://pgl.yoyo.org</a>.
--8<--
*/
?>
Expected result:
----------------
Hi! My homepage is at <a
href="http://pgl.yoyo.org/">http://pgl.yoyo.org</a>.
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=9789&edit=1