本文整理汇总了PHP中XML_Util::isValidname方法的典型用法代码示例。如果您正苦于以下问题:PHP XML_Util::isValidname方法的具体用法?PHP XML_Util::isValidname怎么用?PHP XML_Util::isValidname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XML_Util
的用法示例。
在下文中一共展示了XML_Util::isValidname方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: name
print "splitting qualified tag name (no namespace, but default namespace specified):<br>\n";
print "<pre>";
print_r(XML_Util::splitQualifiedName("foo", "bar"));
print "</pre>";
print "\n<br>\n";
/**
* verifying XML names
*/
print "verifying 'My private tag':<br>\n";
print "<pre>";
print_r(XML_Util::isValidname('My Private Tag'));
print "</pre>";
print "\n<br><br>\n";
print "verifying '-MyTag':<br>\n";
print "<pre>";
print_r(XML_Util::isValidname('-MyTag'));
print "</pre>";
print "\n<br><br>\n";
/**
* creating an XML tag
*/
$tag = array("namespace" => "foo", "localPart" => "bar", "attributes" => array("key" => "value", "argh" => "fruit&vegetable"), "content" => "I'm inside the tag");
print "creating a tag with namespace and local part:<br>";
print htmlentities(XML_Util::createTagFromArray($tag));
print "\n<br><br>\n";
/**
* creating an XML tag
*/
$tag = array("qname" => "foo:bar", "namespaceUri" => "http://foo.com", "attributes" => array("key" => "value", "argh" => "fruit&vegetable"), "content" => "I'm inside the tag");
print "creating a tag with qualified name and namespaceUri:<br>\n";
print htmlentities(XML_Util::createTagFromArray($tag));