Bir. xml dosyasını okur ve. xml dosyasından xml çıkışı veren bir. php dosyası oluşturmak istiyorum

2 Cevap php

Kulağa garip geldiğini biliyorum ama ben bir çözüm için lazım.

So some link in an ActionScript links for a .php file. As I am unable to edit this link in the AS I need some workaround. I have the xml and the .php file needs to output that exact xml code. How can this be done. Ultimately I would like to create a .php script that outputs xml. Where can I find instructions on how to do this? thanks!

2 Cevap

Ben doğru anladım varsa, şu ne soran yapmalıyım:

<?php

$xmlContent = file_get_contents('/path/to/xml/file');

header('Content-type: text/xml; charset=utf-8');

if ($xmlContent) {
   // file available       
   echo $xmlContent;
   exit();
}

// indicate failure, e.g.
echo '<?xml version="1.0" encoding="utf-8?>
<result>
 <status success="0">
</result>';

Eğer böyle bir şey demek istiyorsunuz:

header( 'Content-Type: text/xml', true );
readfile( '/path/to/your/xml/file.xml' );

(Cez' answer kesinlikle daha hatasız)

Yoksa ilk dosyadan bazı xml ayarlamanız gerekiyor demek istiyorsun? Bu durumda aşağıdakilerden biri (veya daha fazla) bakmak isteyebilirsiniz: