note 36283 added to function.strip-tags

From: Date: Fri, 03 Oct 2003 11:45:05 +0000
Subject: note 36283 added to function.strip-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-57716@lists.php.net to get a copy of this message
For coders new to PHP: If you want PHP to output a string WITHOUT parsing any Tags ( HTML, <?, <?php, ?>, ... ) this function may be what you need: $withTags = 'Sometimes <a href="http://www.phatsonic.de">Links</a>'; $withTags .= ' or <b>Design</b>-<i>Tags</i> should not be parsed.'; $withTags .= ' Think about: <?php echo "really bad code"; ?>'; $withoutTags = str_replace(array('<','>'),array('&lt;','&gt;'),$withTags); echo 'The string "text-only": '.$withoutTags; ---- Manual Page -- http://www.php.net/manual/en/function.strip-tags.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+36283 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+36283&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+36283&report=yes

« previous php.notes (#57716) next »