$from=array( '|<([^/][^> ]*)[^>]*>(.*?)|s', '|<[^>]*/ *>|' ); $to=array( '$2', '' ); show(); $code=preg_replace($from, $to, $code);