当前位置: 首页>>代码示例>>PHP>>正文


PHP CDataXML::xmlspecialcharsback方法代码示例

本文整理汇总了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;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:37,代码来源:xmlcreator.php

示例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;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:30,代码来源:xml.php

示例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;
			}
		}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:31,代码来源:player_playlist_edit.php


注:本文中的CDataXML::xmlspecialcharsback方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。