note 107078 added to function.strip-tags

From: Date: Thu, 05 Jan 2012 15:31:56 +0000
Subject: note 107078 added to function.strip-tags
Groups: php.notes 
Request: Send a blank email to php-notes+get-185373@lists.php.net to get a copy of this message
Function to simply test if a given location index is inside a tag in the string function in_tag($str,$index) { //test if $index occurs inside an html tag in $str $before = substr($str,0,$index); $after = substr($str,$index); $prev_lt = strrpos($before,'<'); $next_lt = strpos($after,'<') + $index; $prev_gt = strrpos($before,'>'); $next_gt = strpos($after,'>') + $index; return ($prev_gt < $prev_lt) && ($next_lt > $next_gt); } ---- Server IP: 69.147.83.197 Probable Submitter: 24.89.139.58 ---- Manual Page -- http://www.php.net/manual/en/function.strip-tags.php Edit -- https://master.php.net/note/edit/107078 Del: integrated -- https://master.php.net/note/delete/107078/integrated Del: useless -- https://master.php.net/note/delete/107078/useless Del: bad code -- https://master.php.net/note/delete/107078/bad+code Del: spam -- https://master.php.net/note/delete/107078/spam Del: non-english -- https://master.php.net/note/delete/107078/non-english Del: in docs -- https://master.php.net/note/delete/107078/in+docs Del: other reasons-- https://master.php.net/note/delete/107078 Reject -- https://master.php.net/note/reject/107078 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#185373) next »