Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> SimpleXML nie działa
AboutMe
post
Post #1





Grupa: Zarejestrowani
Postów: 261
Pomógł: 0
Dołączył: 24.02.2008

Ostrzeżenie: (0%)
-----


Dzień dobry (IMG:style_emoticons/default/smile.gif)

Dlaczego poniższy kod nie działa?
  1. $url = "http://domena.com/1/feed.php?mode=topics_active";
  2. $xml = simplexml_load_file($url);
  3. for($i = 0; $i < 10; $i++){
  4. $published = $xml->feed->entry[$i]->published;
  5. $html = "$published<br>";
  6. }
  7. echo $html;


XML - http://pastebin.com/XEtZEfG8

Drugie pytanie czy jest możliwe wyświetlenie zawartości label=""?

Ten post edytował AboutMe 7.11.2016, 17:12:16
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
AboutMe
post
Post #2





Grupa: Zarejestrowani
Postów: 261
Pomógł: 0
Dołączył: 24.02.2008

Ostrzeżenie: (0%)
-----


Kod taki jak w manualu:


  1. <?php
  2. // The file test.xml contains an XML document with a root element
  3. // and at least an element /[root]/title.
  4.  
  5. if (file_exists('test.xml')) {
  6. $xml = simplexml_load_file('test.xml');
  7.  
  8. print_r($xml);
  9. } else {
  10. exit('Failed to open test.xml.');
  11. }
  12. ?>



oczywiście test.xml zmieniony na http://domena.com/1/feed.php?mode=topics_active

Ten post edytował AboutMe 7.11.2016, 23:28:04
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.11.2025 - 14:15