Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 23rd, 2007, 05:25 PM
xx75vulcan
Guest
 
Posts: n/a
Default php to display mysql output text as hyperlink

Hi,

Not sure if this goes to PHP or mySQL group (or both!).

I've got a home brewed blog started using PHP and mySQL to store and
display the entries/postings.

I've figured out that I could format the way the entries are displayed
from the database using nl2br2($string) to properly display paragraph
breaks.

How can I parse the output and display a hyperlink one types in the
body of the entry, into an actual link.

If the body text looks like this for example:
Today I went to the zoo. If you want to visit the zoo, look at their
homepage at www.zoo.com I think you'll like it a lot.

How can I get the output to be parsed, recogonize http:// or www. and
convet the plain text to an actual hyperlink?

Much thanks to those who can offer insight!!

Chris

Aside from the dull entry,

  #2  
Old August 23rd, 2007, 05:45 PM
Michael Fesser
Guest
 
Posts: n/a
Default Re: php to display mysql output text as hyperlink

..oO(xx75vulcan)
Quote:
>How can I parse the output and display a hyperlink one types in the
>body of the entry, into an actual link.
>
>If the body text looks like this for example:
>Today I went to the zoo. If you want to visit the zoo, look at their
>homepage at www.zoo.com I think you'll like it a lot.
>
>How can I get the output to be parsed, recogonize http:// or www. and
>convet the plain text to an actual hyperlink?
Could be done with a regular expression, but it won't be reliable. Not
every URL starts with HTTP or a leading 'www'. What about using BBCode
or something like that?

Micha
 

Bookmarks

Thread Tools

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles