本文整理汇总了PHP中XML_Util::getDocTypeDeclaration方法的典型用法代码示例。如果您正苦于以下问题:PHP XML_Util::getDocTypeDeclaration方法的具体用法?PHP XML_Util::getDocTypeDeclaration怎么用?PHP XML_Util::getDocTypeDeclaration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XML_Util
的用法示例。
在下文中一共展示了XML_Util::getDocTypeDeclaration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlspecialchars
print "\n<br><br>\n";
print "building XML declaration with additional attributes:<br>";
print htmlspecialchars(XML_Util::getXMLDeclaration("1.0", "UTF-8", true));
print "\n<br><br>\n";
/**
* building document type declaration
*/
print "building DocType declaration:<br>\n";
print htmlspecialchars(XML_Util::getDocTypeDeclaration('package', 'http://pear.php.net/dtd/package-1.0'));
print "\n<br><br>\n";
print "building DocType declaration with public ID (does not exist):<br>\n";
print htmlspecialchars(XML_Util::getDocTypeDeclaration('package', array('uri' => 'http://pear.php.net/dtd/package-1.0', 'id' => '-//PHP//PEAR/DTD PACKAGE 0.1')));
print "\n<br><br>\n";
print "building DocType declaration with internal DTD:<br>\n";
print "<pre>";
print htmlspecialchars(XML_Util::getDocTypeDeclaration('package', 'http://pear.php.net/dtd/package-1.0', '<!ELEMENT additionalInfo (#PCDATA)>'));
print "</pre>";
print "\n<br><br>\n";
/**
* creating an attribute string
*/
$att = array("foo" => "bar", "argh" => "tomato");
print "converting array to string:<br>\n";
print XML_Util::attributesToString($att);
print "\n<br><br>\n";
/**
* creating an attribute string with linebreaks
*/
$att = array("foo" => "bar", "argh" => "tomato");
print "converting array to string (including line breaks):<br>\n";
print "<pre>";
示例2: array
echo 'assets url ' . $assets_url;
echo PHP_EOL;
$data = array('foo' => 'bar', 'baz' => 'boom', 'cow' => 'milk', 'php' => 'hypertext processor');
echo http_build_query($data) . "\n";
echo http_build_query($data, '', '&');
echo PHP_EOL;
echo nl2br("Welcome\r\nThis is my HTML document", false);
//lets look at some pear
echo PHP_EOL;
//C:\php\pear\docs\XML_Util\examples\example.php
require_once 'XML/Util.php';
/**
* building document type declaration
*/
print 'building DocType declaration:<br>';
print htmlspecialchars(XML_Util::getDocTypeDeclaration('package', 'http://pear.php.net/dtd/package-1.0'));
print "\n<br><br>\n";
$modes = mcrypt_list_modes();
echo "mcrypt_list_modes <br>\n";
echo print_r_xml($modes);
//F:\bit5411\php\PEAR\OS\Guess.php class OS_Guess
require_once 'OS/Guess.php';
$phpwhat = new OS_Guess();
//$phpwhat = OS_Guess::getSignature(); //fatal this
$tmp = $phpwhat->getSignature();
echo $tmp;
echo PHP_EOL;
$tmp = $phpwhat->getSysname();
echo $tmp;
echo PHP_EOL;
$tmp = $phpwhat->getNodename();