From 8231e0c41b6bcdba16718c1cdaab4e1b40a0d793 Mon Sep 17 00:00:00 2001 From: avl Date: Thu, 12 Feb 2009 21:54:50 +0200 Subject: [PATCH] IPF_Utils::TrimP() --- ipf/utils.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; + } + } -- 2.49.0