Пример #1
0
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
0
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();