0

Possible Duplicate:
Get content within a html tag using php and replace it after processing

I want replace

<a href="#" alt="" title="" class=""....>blalablabla</a>

with: blalablabla

Community
  • 1
  • 1
vinanghinguyen
  • 1,233
  • 4
  • 11
  • 17
  • 2
    I've tried to format to capture the HTML, but I'm not sure it's really what you want. Please edit accordingly if this is not right – Brian Agnew Nov 25 '11 at 13:36

1 Answers1

3

You should use strip_tags() funciton

http://php.net/manual/en/function.strip-tags.php

Here is the example.

$sHTML = '<a href="#" alt="" title="" class=""....>blalablabla</a>';
$sStripped = strip_tags($sHTML);
echo $sStripped; // should echo "blalablabla"
Emir Akaydın
  • 5,708
  • 1
  • 29
  • 57