Howdy, Stranger!

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


Clean-up a long string contents ...

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

1097-6353Title:A-E-C SystemsAdditional Title InformationAdditional Title Information

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


  • acetechcnacetechcn Member Posts: 28
    This post has been deleted.
  • CJNimesCJNimes Member Posts: 13
    Maybe this works:

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

    $oldString ='ISSN:1097-6353';

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

    echo $oldString . "
    echo $newString;

  • CJNimesCJNimes Member Posts: 13
    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.