<div style="background: url(../images/banner_590x170_society.jpg) no-repeat center; padding-top: 38px; background-size: cover; cursor: pointer;" onclick="location.href = '超連接路徑'">
<div style="background: url(../images/banner_590x170_society.jpg) no-repeat center; padding-top: 38px; background-size: cover; cursor: pointer;" onclick="location.href = '超連接路徑'">
<?php /** * 数组转xml字符 * @param string $xml xml字符串 **/ class A2Xml { private $version = '1.0'; private $encoding = 'UTF-8'; private $root = 'root'; private $xml = null; function __construct() { $this->xml = new XmlWriter(); } function toXml($data, $eIsArray=FALSE) { if(!$eIsArray) { $this->xml->openMemory(); $this->xml->startDocument($this->version, $this->encoding); $this->xml->startElement($this->root); } foreach($data as $key => $value){ if(is_array($value)){ $this->xml->startElement($key); $this->toXml($value, TRUE); $this->xml->endElement(); continue; } $this->xml->writeElement($key, $value); } if(!$eIsArray) { $this->xml->endElement(); return $this->xml->outputMemory(true); } } } $res = array( 'hello' => '11212', 'world' => '232323', 'array' => array( 'test' => 'test', 'b' => array( 'c'=>'c', 'd'=>'d' ) ), 'GHPREC_ID' => 'haha' ); $xml = new A2Xml(); echo htmlentities($xml->toXml($res),ENT_QUOTES,"UTF-8"); ?>
這是一篇很好的文章
避免作者把網站刪掉 我的來源失效 在此做個備份