Re: Re: Regex

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



http://www.php.net/manual/en/reference.pcre.pattern.syntax.php

On 8/22/06, Alex Turner <aturner@xxxxxxxxxxxxxxxxxxx> wrote:

If what you mean is a db table, then it would seem to me that you should
not be using a regex.  PHP has rawurlencode() for this sort of thing.

But - you should learn regex ;-)

Try something like (untested and late at night)

function urlme($location)
{
     $enc=rawurlencode($location);
     $spc=htmlspecialchars($location);
     return "<A href='http://$enc'>$spc</a>";
}

AJ

www.project-network.com
www.deployview.com
www.funkifunctions.blogspot.com

M. Sokolewicz wrote:
> Nadim Attari wrote:
>> Hello,
>>
>> I have some text in a table... the text contains hyperlinks (but not
>> html coded, i.e. plain "Some text...http://www.something.com";)
>>
>> When i retrieve these texts from the table, i want the hyperlinks to
>> become clickable, i.e. <a href etc added automatically.
>>
>> "Some text...<a
>> href="http://www.something.com";>http://www.something.com</a>"
>>
>> I know this sould be done using Regex, but i don't know regex.
>>
>> Any help (links, examples, etc)
>>
>> Thanks
>> Nadim Attari
>
> You don't know Regex. Well, that's simple then, TRY to learn it. Noone
> will (or should) give you any answers if it's absolutely clear that
> you're not putting any effort into trying to find one yourself. "I know
> this should be done using Regex, but I don't know regex.", wouldn't you
> think it'd be a good idea to look up a tutorial somewhere or try to find
> out what this "regex" exactly is? Try to type regex in the php doc, see
> the notes for the various functions?
>
> really, a little more effort goes a long way.
> - tul

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
GMail Rocks!!!

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux