當前位置: 首頁>>代碼示例>>PHP>>正文


PHP MarkupClose函數代碼示例

本文整理匯總了PHP中MarkupClose函數的典型用法代碼示例。如果您正苦於以下問題:PHP MarkupClose函數的具體用法?PHP MarkupClose怎麽用?PHP MarkupClose使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了MarkupClose函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Cells

function Cells($name, $attr)
{
    global $MarkupFrame;
    $attr = PQA($attr);
    $tattr = @$MarkupFrame[0]['tattr'];
    $name = strtolower($name);
    $key = preg_replace('/end$/', '', $name);
    if (preg_match("/^(?:head|cell)/", $name)) {
        $key = 'cell';
    }
    $out = '<:block>' . MarkupClose($key);
    if (substr($name, -3) == 'end') {
        return $out;
    }
    $cf =& $MarkupFrame[0]['closeall'];
    if ($name == 'table') {
        $MarkupFrame[0]['tattr'] = $attr;
    } else {
        if ($key == 'cell') {
            if (strpos($attr, "valign=") === false) {
                $attr .= " valign='top'";
            }
            $t = strpos($name, 'head') === 0 ? 'th' : 'td';
            if (!@$cf['table']) {
                $tattr = @$MarkupFrame[0]['tattr'];
                $out .= "<table {$tattr}><tr><{$t} {$attr}>";
                $cf['table'] = '</tr></table>';
            } else {
                if (preg_match("/nr\$/", $name)) {
                    $out .= "</tr><tr><{$t} {$attr}>";
                } else {
                    $out .= "<{$t} {$attr}>";
                }
            }
            $cf['cell'] = "</{$t}>";
        } else {
            $out .= "<div {$attr}>";
            $cf[$key] = '</div>';
        }
    }
    return $out;
}
開發者ID:libcrack,項目名稱:pmwiki,代碼行數:42,代碼來源:stdmarkup.php

示例2: Cells

function Cells($name, $attr)
{
    global $MarkupFrame;
    $attr = PQA($attr);
    $tattr = @$MarkupFrame[0]['tattr'];
    $name = strtolower($name);
    $key = preg_replace('/end$/', '', $name);
    if (strncmp($key, 'cell', 4) == 0) {
        $key = 'cell';
    }
    $out = '<:block>' . MarkupClose($key);
    if (substr($name, -3) == 'end') {
        return $out;
    }
    $cf =& $MarkupFrame[0]['closeall'];
    if ($name == 'table') {
        $MarkupFrame[0]['tattr'] = $attr;
    } else {
        if (strncmp($name, 'cell', 4) == 0) {
            if (strpos($attr, "valign=") === false) {
                $attr .= " valign='top'";
            }
            if (!@$cf['table']) {
                $tattr = @$MarkupFrame[0]['tattr'];
                $out .= "<table {$tattr}><tr><td {$attr}>";
                $cf['table'] = '</td></tr></table>';
            } else {
                if ($name == 'cellnr') {
                    $out .= "</td></tr><tr><td {$attr}>";
                } else {
                    $out .= "</td><td {$attr}>";
                }
            }
            $cf['cell'] = '';
        } else {
            $out .= "<div {$attr}>";
            $cf[$key] = '</div>';
        }
    }
    return $out;
}
開發者ID:BogusCurry,項目名稱:pmwiki,代碼行數:41,代碼來源:stdmarkup.php

示例3: Cells

function Cells($name,$attr) {
  global $MarkupFrame, $EnableTableAutoValignTop;
  $attr = PQA($attr);
  $tattr = @$MarkupFrame[0]['tattr'];
  $name = strtolower($name);
  $key = preg_replace('/end$/', '', $name);
  if (preg_match("/^(?:head|cell)(nr)?$/", $name)) $key = 'cell';
  $out = '<:block>'.MarkupClose($key);
  if (substr($name, -3) == 'end') return $out;
  $cf = & $MarkupFrame[0]['closeall'];
  if ($name == 'table') $MarkupFrame[0]['tattr'] = $attr; 
  else if ($key == 'cell') {
    if (IsEnabled($EnableTableAutoValignTop, 1) && strpos($attr, "valign=")===false)
      $attr .= " valign='top'";
    $t = (strpos($name, 'head')===0 ) ? 'th' : 'td';
    if (!@$cf['table']) {
       $tattr = @$MarkupFrame[0]['tattr'];
       $out .= "<table $tattr><tr><$t $attr>";
       $cf['table'] = '</tr></table>';
    } else if ( preg_match("/nr$/", $name)) $out .= "</tr><tr><$t $attr>";
    else $out .= "<$t $attr>";
    $cf['cell'] = "</$t>";
  } else {
    $tag = preg_replace('/\\d+$/', '', $key);
    $out .= "<$tag $attr>";
    $cf[$key] = "</$tag>";
  }
  return $out;
}
開發者ID:BogusCurry,項目名稱:pmwiki,代碼行數:29,代碼來源:stdmarkup.php


注:本文中的MarkupClose函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。