Clean-up a long string contents ...

Hello everyone,
I tried to clean-up some html tags(i.e. , , image, etc) and just leave Expresions expressions for the given string below.

[code]
ISSN:
1097-6353Title:A-E-C SystemsAdditional Title InformationAdditional Title Information
[/code]

I tried several way with regular expressions but could not succeed.
Any help will be apperciated ...
thank you.


Comments

  • This post has been deleted.
  • Maybe this works:

    $search = "%(<[A-Za-z]+)(.*?)(>)%is";
    $replace = "\1\3";
    $newString = preg_replace($search,$replace, $oldString);
  • Why not just use the strip_tags function?

    [code]
    $oldString ='ISSN:1097-6353';

    $newString = strip_tags($oldString, '');

    echo $oldString . "
    ";
    echo $newString;
    [/code]



  • I think he wants to clean styles also and strip_tags don't work for that.

    If you have something like "hello" with strip_tags will result "hello" and I guess he wants to get "hello".
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories