From: avl Date: Thu, 12 Feb 2009 19:54:50 +0000 (+0200) Subject: IPF_Utils::TrimP() X-Git-Tag: 0.5~417 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=8231e0c41b6bcdba16718c1cdaab4e1b40a0d793;p=ipf.git IPF_Utils::TrimP() --- diff --git a/ipf/utils.php b/ipf/utils.php index 2ed6b64..fb71f24 100644 --- a/ipf/utils.php +++ b/ipf/utils.php @@ -223,5 +223,17 @@ class IPF_Utils { list($f,$i) = split(' ',microtime()); return $i.substr((string)$f,2,6); } + + static function TrimP($html) + { + $strL = "

"; $lenL = 3; + $strR = "

"; $lenR = 4; + if (0 == strcasecmp(substr($html, 0, $lenL), $strL) + && 0 == strcasecmp(substr($html, -$lenR), $strR)){ + return substr($html, $lenL, strlen($html) - ($lenL + $lenR)); + } + return $html; + } + }