simplexml

    1熱度

    1回答

    我有一個相當簡單的一塊PHP代碼, $xml = file_get_contents($url, false, $context); $response = simplexml_load_string($xml); $status_response = $response->xpath('/PollSessionResponseDto/Status'); $answer = $status_

    1熱度

    1回答

    好吧,我有一些問題,因爲我不能看我的XML的某些部分: file.xml <main> <a> <b> <c> ok1 </c> </b> <b> <c> ok2 </c> </b> </a> </main> 我可以打開XML文件,但我不能看到'ok2'的價值,希望你能幫助我,謝謝。

    0熱度

    1回答

    嘗試從URL創建SimpleXMLElement的新實例時,出現錯誤Uncaught exception 'Exception' with message 'String could not be parsed as XML'。 詳細說明: $feed_url = 'https://www.ua.edu/news/feed/'; $the_feed = new SimpleXMLElement(

    0熱度

    1回答

    我正在繼承一個網站,只是將所有內容切換到php7。由於此開關,我一直在發現很多錯誤。一個錯誤是函數simplexml_load_file()沒有返回任何東西。我向它傳遞了一個變量,該變量已設置爲服務器上的文件路徑(即/dir/dir/dir/template.xml)。但是當這個函數被調用時,它不會返回任何值,既不是我們想要的對象也不是一個0來表示它失敗。 我沒有經驗的PHP,所以我很難找出出了什

    1熱度

    1回答

    請保持明在所有這裏閱讀很多「相關」的答案,並在使用谷歌之前來找你。 這是我在PHP中使用PHP代碼的第一手資料。 下面是XML文件(的test.xml)我看: <quizReport xmlns="http://empty.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://em

    -2熱度

    1回答

    <?xml version="1.0" encoding="ISO-8859-1"?> <note> <to>George</to> <from>John</from> <heading>Reminder</heading> <body>Don't forget the meeting!</body> </note> 如何使用PHP來呼應XML信息

    1熱度

    2回答

    我們有一個XML字典文件是這樣的: <?xml version="1.0" encoding="UTF-8"?> <words> <word> <phrase lang="IR">حسابدار</phrase> <phrase lang="FR">Comptable</phrase> <phrase lang="CN">會計</phrase>

    1熱度

    1回答

    <?xml version="1.0" encoding="UTF-8"?> <abc-response> <error-messages> <errors code="302"> User does not have access to this Product </errors> </error-messages> </abc-r

    0熱度

    2回答

    我的代碼是有點工作,但我沒有得到我想要的輸出,我從字面上只是想輸出「溫柔的微風」,而是我得到「SimpleXMLElement對象([0] = >微風)」 這裏是我的代碼: <head> <title>Open Weather API</title> </head> <body> <?php $url = "http://api.openweathermap.o

    0熱度

    1回答

    我有一個像下面一個xml, <y> <n> <n id='test1'></n> <n id='test2'></n> </n> </y> ,並希望每個孩子閱讀的「ID」,「N」標記。 我使用這個php代碼; $xml = simplexml_load_file("my.xml"); echo $xml->n[0]->n; ,但得到的錯誤, 試圖讓非對象的屬性