php4 xml Éú³ÉÀà
ÓÉÓÚ ÔÚphp4µÄ»·¾³ÏÂ. ¶¼Ã»ÕÒµ½×Ô¶¯Éú³ÉµÄº¯Êý. ËùÒÔ×Ô¼º¸ÄдÁËÒ»¸ö±ðÈËЩµÄÀà. ÓÃÀ´×Ô¶¯Éú³Éxml Îļþ.
<?php
/*
*** ¹¦ÄÜ : php4×Ô動Éú³Éxml Îļþ類
*** @ edit: zxwo0o
*** @ time: 2009-9-22
*/
class php4xml{
var $version; //°æ±¾號
var $start; //¸ù節點開ʼÐÐ
var $end; //¸ù節點結ÊøÐÐ
var $xml_document;//xmlÎÄ檔µÄÖÐ間內ÈÝ
var $root_end; //節點結Êø 數組 ..ÓÃì¶¶à層節點
/*
*** ¹¦ÄÜ : 構Ô캯數
*** @ $ver: xml °æ±¾號
*** @ $encoding: xml ÎÄ檔編碼
*/
function php4xml($ver='1.0',$encoding='utf-8'){
$this->version="<?xml version=\"{$ver}\" encoding=\"{$encoding}\"?>";
$this->root_end = array(); //聲Ã÷為數組 ÓÃì¶區·Ö 層級.
}
/*
*** ¹¦ÄÜ : Ìí¼Ó¸ù節點開啟×Ö·û´®.°æ±¾號ÐÅÏ¢ 記錄¸ù節點結Êø×Ö·û´®
*** @ $element: ¸ù節點ÔªËØÃû稱
*** return : ³É¹¦·µ»Ø trun
*/
function root($element){
$element=$this->filter($element);
if(isset($this->start) and isset($this->end)){
exit("error:Only one top level element is allowed in an XML document.\r\n");
}else{
$this->start="<$element>";
$this->end="</$element>";
$this->xml_document=$this->version."\n".$this->start."\n";
return true;
}
}
/*
*** ¹¦ÄÜ : Ìí¼Ó節點開ʼ×Ö·û´®.屬ÐÔÃû稱.屬ÐÔÖµ. 記錄節點結Êø×Ö·û´®
*** @ $title: 節點ÔªËØÃû稱
*** @ $level: 節點ÔªËØËùÔÚµÄ層級 Ĭ認 0 ±íʾ¸ù節點µÄÏÂÒ»個節點
*** @ $property: 屬ÐÔÃû稱 Ŀǰֻ֧³Ö設ÖÃÒ»個屬ÐÔ
*** @ $pro_val: 屬ÐÔÖµ
Ïà¹ØÎĵµ£º
ÏÈ¿´¿´Ï±ßÕâ¶ÎPHP´úÂë¡£Õâ¶ÎʹÓÃip2longº¯Êý£¬¶Ôͬһ¸öIP½øÐÐת»»¡£µ±È»£¬Ò²ÓÐÈËÈÏΪ58.99.011.1ºÍ058.99.011.1Ëã²»ÉϺϷ¨µÄ
IP£¬ÄǾÍReturn£¬´ËÎĶÔÄãûÓаïÖú¡£
ΪʲôҪʹÓôøÇ°µ¼ÁãµÄip£ºÎªÁËÔÚÊý¾Ý¿âÖвéѯ£¬Õâ¸ö¿ÉÒÔÔÚIP¿âÖж¨Î»µ½ipËù¶ÔÓ¦µÄλÖÃÐÅÏ¢¡£ËäȻûÓÐÕûÐ͵ÄIP²éѯЧÂʸߣ¬µ«±Ï¾¹Ö±¹Û°¡¡£
<?php
ech ......
PHP4:
<?
$sample1 = new StdClass();
$sample1->name = "Hasin";
$sample2 = $sample1;
$sample2->name = "Afif";
echo $sample1->name;
?>
In PHP4 it works differently; it will output Hasin, as both are different from
each other.
PHP5:
<?
$sample1 = new StdClass();
$ ......
Ò»°ãÇé¿öÏ£¬ÔÚ¿ª·¢»·¾³ÖзÃÎÊÒ»¸ö¾ßÌåÉÌÆ·µÄURLÊÇÕâÑùµÄ£º
http://localhost/phptest/show.php?id=1
µ«ÊÇÎÒÐèÒª¸ü¸ÄÒ»ÏÂURL£¬¶ÔËÑË÷ÒýÇæ¸üÓѺã¬È磺
http://localhost/phptest/1.html
ÕâÖ»ÊǾÙÀý°ÕÁË¡£
ÏÂÃæÎÒÃÇÀ´¿´¿´£¬ÕâÁ½ÌìÁ´½Ó×îºó´ïµ½µÄЧ¹ûÊÇÒ»ÑùµÄ£¬Çë×¢Òâä¯ÀÀÆ÷µØÖ·£¡
1¡¢Õý³£·ÃÎÊ£º
2¡¢Î±¾²Ì¬ºó£º
½ÓÏÂÀ ......
If you want to put some big table in the pdf file, you may got the layout messy. One way to solve the problem is to change the paper size. In "includes/cpdf_adapter.cls.php", Change the size you used in the array to whatever you want.
One tip: Replace Url into Clickable link.
$tex ......
/*
>>> Title : Ewebeditor±à¼Æ÷ǶÈëµ½PHPÍøÒ³ÖÐ
>>> Author: Áõ³¿êÍ
>>> Date : 2009-07-05
>>> EMAIL :
huichengongzi@gmail.com
>>> ×ªÔØÇë×¢Ã÷³ö´¦£¬Ð»Ð»ºÏ×÷£¡
*/
£¨1£©ÔÚ
</head>
֮ǰ¼ÓÉÏÏÂÃæÒ»¶Î´úÂ룺£¨µÃ ......