PHP file na-convert sa XML

<?
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 ;
}

/ / Simulan ang XML file, echo magulang node
; echo na '<items>';

'<item echo;
. parseToXML ( stripslashes ( $sName )) . '" ' ; echo 'name = "' parseToXML (stripslashes ($ sName)). '"';
. parseToXML ( stripslashes ( $sAddress )) . '" ' ; echo 'address = "' parseToXML (stripslashes ($ sAddress)). '"';
. parseToXML ( $iPrice ) . '" ' ; echo 'presyo = "' parseToXML ($ iPrice). '"';
. parseToXML ( $sLink ) . '" ' ; echo 'na link = "' parseToXML ($ tumalilis). '"';
. parseToXML ( stripslashes ( $tDetails )) . '" ' ; echo 'detalye = "' parseToXML (stripslashes ($ tDetails)). '"';
. parseToXML ( stripslashes ( $sOther )) . '" ' ; 'iba pang = echo "'. parseToXML (stripslashes ($ sOther)). '"';
; echo '/>';

/ / End XML file
; echo '</ item>';

?>

Maaari mong iwanan ang isang sagot , o trackback mula sa iyong sariling site.

-Iwan ng sagot

Kailangan mong naka-log in upang mag-post ng isang puna.