Jump to content

[Help] Convert urls to link in content have tag html


danglam

Recommended Posts

Hello everybody.

Have a good day.

I'm Lam, I have problem hope you help me.

 

1. This is content html

 

I want convert to

<img src="http://example.com/logo.png" /> anti <a href="http://google.com">http://google.com</a><br /> and <a href="http://bing.com">http://bing.com</a>

 

and this code php

preg_replace("/(http:\/\/[a-zA-Z-0-9._?\/\s]+)/", "<a href=\"$1\">$1</a>", $content);

 

but result

<img src="[color=red]<a href="http://example.com/logo.png">http://example.com/logo.png</a>[/color]" /> anti <a href="http://google.com">http://google.com</a><br /> and <a href="http://bing.com">http://bing.com</a>

 

I can help me  :'(

I speak English not well hope u ignoring

thanks.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.