本文整理汇总了PHP中CDataXML::xmlspecialcharsback方法的典型用法代码示例。如果您正苦于以下问题:PHP CDataXML::xmlspecialcharsback方法的具体用法?PHP CDataXML::xmlspecialcharsback怎么用?PHP CDataXML::xmlspecialcharsback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDataXML
的用法示例。
在下文中一共展示了CDataXML::xmlspecialcharsback方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createTagAttributed
function createTagAttributed($heavyTag, $value = null)
{
$heavyTag = trim($heavyTag);
$name = $heavyTag;
$attrs = 0;
$attrsPos = strpos($heavyTag, " ");
if ($attrsPos) {
$name = substr($heavyTag, 0, $attrsPos);
$attrs = strstr(trim($heavyTag), " ");
}
if (!trim($name)) {
return false;
}
$nameSplited = explode(":", $name);
if ($nameSplited) {
$name = $nameSplited[count($nameSplited) - 1];
}
$name = CDataXML::xmlspecialcharsback($name);
$node = new CXMLCreator($name);
if ($attrs and strlen($attrs)) {
$attrsSplit = explode("\"", $attrs);
$i = 0;
while ($validi = strpos(trim($attrsSplit[$i]), "=")) {
$attrsSplit[$i] = trim($attrsSplit[$i]);
// attr:ns=
$attrName = CDataXML::xmlspecialcharsback(substr($attrsSplit[$i], 0, $validi));
// attrs:ns
$attrValue = CDataXML::xmlspecialcharsback($attrsSplit[$i + 1]);
$node->setAttribute($attrName, $attrValue);
$i = $i + 2;
}
}
if (null !== $value) {
$node->setData($value);
}
return $node;
}
示例2: preg_match_all
function &__parseAttributes($attributeString)
{
$ret = false;
preg_match_all("/(\\S+)\\s*=\\s*([\"'])(.*?)\\2/s" . BX_UTF_PCRE_MODIFIER, $attributeString, $attributeArray);
foreach ($attributeArray[0] as $i => $attributePart) {
$attributePart = trim($attributePart);
if ($attributePart != "" && $attributePart != "/") {
$attributeName = $attributeArray[1][$i];
// strip out namespace; nameSpace:Name
if ($this->delete_ns) {
$colonPos = strpos($attributeName, ":");
if ($colonPos > 0) {
// exclusion: xmlns attribute is xmlns:nameSpace
if ($colonPos == 5 && substr($attributeName, 0, $colonPos) == 'xmlns') {
$attributeName = 'xmlns';
} else {
$attributeName = substr($attributeName, $colonPos + 1);
}
}
}
$attributeValue = $attributeArray[3][$i];
unset($attrNode);
$attrNode = new CDataXMLNode();
$attrNode->name = $attributeName;
$attrNode->content = CDataXML::xmlspecialcharsback($attributeValue);
$ret[] =& $attrNode;
}
}
return $ret;
}
示例3: Array
if (strtolower($tls[$i_]->name) != 'tracklist')
continue;
$tracks = $tls[$i_]->children;
for ($i = 0, $l = count($tracks); $i < $l; $i++)
{
$bIncorrectFormat = false;
$track = $tracks[$i];
if (strtolower($track->name) == 'track')
{
$arTrack = Array('title' => '', 'author' => '', 'location' => '', 'image' => '', 'duration' => '');
for ($j = 0, $n = count($track->children); $j < $n; $j++)
{
$prop = $track->children[$j];
if (strtolower($prop->name) == 'title')
// TODO: Maybe using xmlspecialcharsback - is bogus
$arTrack['title'] = $objXML->xmlspecialcharsback($prop->content);
if (strtolower($prop->name) == 'creator')
$arTrack['author'] = $objXML->xmlspecialcharsback($prop->content);
if (strtolower($prop->name) == 'location')
$arTrack['location'] = $objXML->xmlspecialcharsback($prop->content);
if (strtolower($prop->name) == 'image')
$arTrack['image'] = $objXML->xmlspecialcharsback($prop->content);
if (strtolower($prop->name) == 'duration')
$arTrack['duration'] = $objXML->xmlspecialcharsback($prop->content);
}
$arTracks[] = $arTrack;
}
}
break;
}
}