當前位置: 首頁>>代碼示例>>PHP>>正文


PHP XML_Util::getDocTypeDeclaration方法代碼示例

本文整理匯總了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>";
開發者ID:bantudevelopment,項目名稱:polysmis,代碼行數:31,代碼來源:example.php

示例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, '', '&amp;');
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();
開發者ID:gmgj,項目名稱:gjsoap,代碼行數:31,代碼來源:gjrsi.php


注:本文中的XML_Util::getDocTypeDeclaration方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。