I have this HTML code exp. Lorem ipsum dorem, <a href="http://example.com/link1">link</a> koloris dominu trapem <a href="http://example.com/link1">link</a> op absb <strong>tip</strong>. Code (markup): With preg_match i need just text, can someone show me how, i know to remove all and inside <>, but firs time I need also inside code. The result must be: Lorem ipsum dorem, link koloris dominu trapem link op absb tip. Code (markup):
So you basically want to strip the tags? Try this: <?php /** * Strip HTML Tags * Script by Dennis M. * */ $text = 'Lorem ipsum dorem, <a href="http://example.com/link1">link</a> koloris dominu trapem <a href="http://example.com/link1">link</a> op absb <strong>tip</strong>.'; $text = preg_replace("/<.+?>/","",$text); print $text; ?> PHP: Use preg_replace instead of preg_match. Regards, Dennis M.
use strip_tags() function: echo strip_tags('Lorem ipsum dorem, <a href="http://example.com/link1">link</a> koloris dominu trapem <a href="http://example.com/link1">link</a> op absb <strong>tip</strong>.'); PHP: