Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,190,366 members, 7,940,406 topics. Date: Thursday, 05 September 2024 at 03:51 AM

Help With Preg_replace And Ereg_replace - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Help With Preg_replace And Ereg_replace (490 Views)

(2) (3) (4)

(1) (Reply)

Help With Preg_replace And Ereg_replace by adex3g(m): 11:04am On Aug 25, 2014
$AOG_te = ereg_replace("http://[A-Za-z0-9./=?-_]+","<a href=\"\\0\">\\0</a>", $AOG_te);
$AOG_te = preg_replace("/\[url\=(.*?)\](.*?)\[\/url\]/is","<a href=\"$1\">$2</a>",$AOG_te);
i have that above code in my bbcode function.
But ereg_replace did not allow the preg_replace to work, what can i do so that two will work without affecting each other.
If user post http:// nairaland.com or [ url=http:// nairaland.com]nairaland[/url] should turn to link.

(1) (Reply)

Discover A News Tracking Website / In Need Of Website Enter Here For Cheaper Price / Get Your Website Built And Designed Faster!!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 6
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.