PHP dosyası XML dönüştürmek

<?
function parseToXML ( $htmlStr )
{
$xmlStr = str_replace ( '<' , '&lt;' , $htmlStr );
$xmlStr = str_replace ( '>' , '&gt;' , $xmlStr );
$xmlStr = str_replace ( '"' , '&quot;' , $xmlStr );
$xmlStr = str_replace ( "'" , '&apos;' , $xmlStr );
$xmlStr = str_replace ( "&" , '&amp;' , $xmlStr );
return
$xmlStr ;
}

/ / Echo üst düğüm, XML dosyası Başlat
; echo '<items>';

echo '<madde';
. parseToXML ( stripslashes ( $sName )) . '" ' ; echo 'name = "' parseToXML (stripslashes ($ sname)).. '"';
. parseToXML ( stripslashes ( $sAddress )) . '" ' ; echo 'adresi = "' parseToXML (stripslashes ($ sAddress)).. '"';
. parseToXML ( $iPrice ) . '" ' ; echo 'fiyat = "' parseToXML ($ iPrice).. '"';
. parseToXML ( $sLink ) . '" ' ; echo 'link = "' parseToXML ($ slink).. '"';
. parseToXML ( stripslashes ( $tDetails )) . '" ' ; echo 'bilgi = "' parseToXML (stripslashes ($ tDetails)).. '"';
. parseToXML ( stripslashes ( $sOther )) . '" ' ; echo 'diğer = "'. parseToXML (stripslashes ($ sOther)). '"';
; echo '/>';

/ / End XML dosyası
; echo '</ öğeleri>';

?>

Şunları yapabilirsiniz yanıt bırakın , veya trackback kendi sitesinden.

Bir Yanıt bırak

Siz gereken oturum Yorum yazmak için.