本文整理匯總了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));