Professional Web Applications Themes

Remove links from a string - PHP Development

Hi everybody. Can anybody tell me how I can take all hyperlinks out of a string? Example: I have a string like this: 'blah blah bubble <a href="http://www.google.com/">googling's funny</a> bubble blah'. And it should transformed to 'blah blah bubble googling's funny bubble blah'. Thanx already! -- Philip Seeger...

  1. #1

    Default Remove links from a string

    Hi everybody.

    Can anybody tell me how I can take all hyperlinks out of a string?
    Example: I have a string like this: 'blah blah bubble <a
    href="http://www.google.com/">googling's funny</a> bubble blah'.
    And it should transformed to 'blah blah bubble googling's funny bubble
    blah'.

    Thanx already!

    --
    Philip Seeger


    Philip Guest

  2. #2

    Default Re: Remove links from a string

    Philip Seeger wrote: 

    You can try experimenting with "strip_tags" function.

    Hilarion


    Hilarion Guest

  3. #3

    Default Re: Remove links from a string

    Philip Seeger wrote:
     

    strip_tags()

    Phil Guest

  4. #4

    Default Re: Remove links from a string

    That works, thank you very much!

    Philip

    "Hilarion" <op.SMIECI.pl> schrieb im Newsbeitrag
    news:dauk1k$sb$onet.pl... 
    >
    > You can try experimenting with "strip_tags" function.
    >
    > Hilarion
    >[/ref]


    Philip Guest

  5. #5

    Default Re: Remove links from a string

    Phil wrote: 
    >
    >
    > strip_tags()
    >[/ref]
    While strip_tags() removes all html tags from a string this is perhaps not that what the
    OP wants. I guess he is more looking for a regular expression like this:

    /<a.*>|</a>/iu

    Regards
    Stefan
    Stefan Guest

Similar Threads

  1. remove favorite links
    By S.NET in forum Windows Vista
    Replies: 5
    Last Post: May 10th, 05:27 PM
  2. remove html tags in string
    By Photoshare in forum Coldfusion - Getting Started
    Replies: 0
    Last Post: August 9th, 06:30 PM
  3. how to remove email & links ?
    By Fred in forum PHP Development
    Replies: 2
    Last Post: January 24th, 04:02 PM
  4. Replies: 2
    Last Post: January 23rd, 01:34 PM
  5. How to remove diacritic of a string
    By Vladish in forum PHP Development
    Replies: 2
    Last Post: January 22nd, 11:42 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139