本文整理汇总了PHP中_MiniXMLLog函数的典型用法代码示例。如果您正苦于以下问题:PHP _MiniXMLLog函数的具体用法?PHP _MiniXMLLog怎么用?PHP _MiniXMLLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_MiniXMLLog函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toString
function toString($depth = 0)
{
$retString = $this->xxmlDoc->toString($depth);
if ($depth == MINIXML_NOWHITESPACES) {
$xmlhead = "<?xml version=\"1.0\"\\1?>";
} else {
$xmlhead = "<?xml version=\"1.0\"\\1?>\n ";
}
$search = array("/<PSYCHOGENIC_ROOT_ELEMENT([^>]*)>\\s*/smi", "/<\\/PSYCHOGENIC_ROOT_ELEMENT>/smi");
$replace = array($xmlhead, "");
$retString = preg_replace($search, $replace, $retString);
if (MINIXML_DEBUG > 0) {
_MiniXMLLog("MiniXML::toString() Returning XML:\n{$retString}\n\n");
}
return $retString;
}
示例2: toStringNoWhiteSpaces
function toStringNoWhiteSpaces()
{
if (MINIXML_DEBUG > 0) {
_MiniXMLLog("MiniXMLNode::toStringNoWhiteSpaces() call with depth {$depth}");
}
if (!is_null($this->xtext)) {
/* a text element */
$retStr = $this->xtext;
} elseif (!is_null($this->xnumeric)) {
/* a numeric element */
$retStr = $this->xnumeric;
}
return $retStr;
}
示例3: toStringNoWhiteSpaces
function toStringNoWhiteSpaces()
{
$retString = '';
$attribString = '';
$elementName = $this->xname;
foreach ($this->xattributes as $attrname => $attrvalue) {
$attribString .= "{$attrname}=\"{$attrvalue}\" ";
}
$retString = "<{$elementName}";
if ($attribString) {
$attribString = rtrim($attribString);
$retString .= " {$attribString}";
}
if (!$this->xnumChildren) {
/* No kids -> no sub-elements, no text, nothing - consider a <unary/> element */
$retString .= " />";
return $retString;
}
/* If we've gotten this far, the element has
** kids or text - consider a <binary>otherstuff</binary> element
*/
$retString .= ">";
/* Loop over all kids, getting associated strings */
for ($i = 0; $i < $this->xnumChildren; $i++) {
if (method_exists($this->xchildren[$i], 'toStringNoWhiteSpaces')) {
$newStr = $this->xchildren[$i]->toStringNoWhiteSpaces();
if (!is_null($newStr)) {
$retString .= $newStr;
}
} else {
_MiniXMLLog("Invalid child found in {$elementName}");
}
/* end if has a toString method */
}
/* end loop over all children */
/* add the indented closing tag */
$retString .= "</{$elementName}>";
return $retString;
}