Back to PhocacartPdf class

Method skipStartAndLastTag

public static
skipStartAndLastTag
(mixed $text, mixed $tag = 'p')

Method skipStartAndLastTag - Source code

public static function skipStartAndLastTag($text, $tag = 'p')
{
    $pattern = "=^<" . $tag . ">(.*)</" . $tag . ">\$=i";
    preg_match($pattern, $text, $matches);
    if (isset($matches[1])) {
        return $matches[1];
    }
    return $text;
}