Results 1 to 2 of 2

Thread: URL Replace

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    968

    URL Replace

    Hi,

    Im tring to wrap a url in code blocks using the replace method. This is the method im using currently:

    Code:
    $replace = "Replace text here";
    $message = preg_replace("#<a href=(.*?)</a>#ims", "$replace", $message);
    But what I want now, is to add [code] block on either end and not replace the actual url.

    Hope you knwo what I mean lol

  2. #2
    Frenzied Member
    Join Date
    Jan 2008
    Posts
    1,754

    Re: URL Replace

    You want to replace the <a href> tags with [code] tags?

    Or you want to wrap [code] tags around the actual URL located within the href attribute?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width