开发者

About xml and php

I have to insert the xml processing instruction into xml file without openin开发者_JS百科g that file means i have to insert that through PHP.anyone please helpme.


I guess with "XML processing instruction" you mean basically something like

<?xml version="1.0" ?>

Please note, that this is (as per spec) no processing instruction and will in all DOM tools never appear as one.

If you try to output this in PHP and find problems you most likely have the PHP.ini's short_open_tag directive set to On. Two possibilities:

  1. Set short_open_tags = Off in your php.ini

  2. echo the stuff:

-

echo '<?xml version="1.0"?>'."\n";


That can't be done without opening the file. How else are you supposed to get the data? Even functions such as file_get_contents() cause the file to be opened, it just closes it again immediately after. If this is not what you mean by open you might want to edit your question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜