change mime type of output in php

后端 未结 6 1442
时光取名叫无心
时光取名叫无心 2020-12-03 04:32

I\'ve got a php script. Most of the time the script returns html, which is working fine, but on one occasion (parameter ?Format=XML) the script returns XML instead of HTML.<

6条回答
  •  眼角桃花
    2020-12-03 04:48

    header('Content-type: application/xml');
    

    More information available at the PHP documentation for header()

提交回复
热议问题