What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Preg replace syntax

Preg replace syntax
Author: Message:
bramvandeperre
Junior Member
**

Avatar
Some random dude

Posts: 56
Reputation: 3
32 / Male / Flag
Joined: Oct 2007
Status: Away
O.P. Preg replace syntax
Heya all!

I got some little question for you.
code:
<img src="image.png" alt="blah" /> this is an image.


should become
code:
<a href="image.png">blah</a> this is an image.


I wanted to do this using a preg replace, but I suck in writing patterns.

Can anyone help? make sure that images are changed into hyperlinks... if there's no alt, the filename should be the text (so not only preg_replace but also some if/else thingies :P

thanks in advance

Bram

oh almost forgot: it's PHP...

This post was edited on 12-05-2008 at 11:17 PM by bramvandeperre.
12-05-2008 10:54 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Preg replace syntax - by bramvandeperre on 12-05-2008 at 10:54 PM
RE: Preg replace syntax - by Ezra on 12-05-2008 at 11:31 PM
RE: RE: Preg replace syntax - by bramvandeperre on 12-05-2008 at 11:40 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On