Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [XML][PHP]pobieranie wartość z XML za pomocą xpath
pabito
post
Post #1





Grupa: Zarejestrowani
Postów: 77
Pomógł: 4
Dołączył: 14.05.2013

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


Witam
Mam taką strukturę, w jaki sposób mogę pobrać datę(data_eveniment) tylko dlatego obiektu gdzie cod_eveniment = "OK"

  1. array(5) {
  2. [0]=>
  3. object(SimpleXMLElement)#2 (7) {
  4. ["data_eveniment"]=>
  5. string(19) "2014-06-25T10:37:20"
  6. ["centru"]=>
  7. string(9) "BUCURESTI"
  8. ["cod_eveniment"]=>
  9. string(2) "OK"
  10. ["descriere_eveniment"]=>
  11. string(7) "Livrata"
  12. ["persoana_livrare"]=>
  13. string(16) "renato pesamosca"
  14. ["observatii_livrare"]=>
  15. object(SimpleXMLElement)#7 (0) {
  16. }
  17. ["motiv"]=>
  18. object(SimpleXMLElement)#8 (0) {
  19. }
  20. }
  21. [1]=>
  22. object(SimpleXMLElement)#3 (7) {
  23. ["data_eveniment"]=>
  24. string(19) "2014-06-25T08:52:42"
  25. ["centru"]=>
  26. string(9) "BUCURESTI"
  27. ["cod_eveniment"]=>
  28. string(2) "WC"
  29. ["descriere_eveniment"]=>
  30. string(15) "Spre destinatar"
  31. ["persoana_livrare"]=>
  32. object(SimpleXMLElement)#8 (0) {
  33. }
  34. ["observatii_livrare"]=>
  35. object(SimpleXMLElement)#7 (0) {
  36. }
  37. ["motiv"]=>
  38. object(SimpleXMLElement)#9 (0) {
  39. }
  40. }
  41. [2]=>
  42. object(SimpleXMLElement)#4 (7) {
  43. ["data_eveniment"]=>
  44. string(19) "2014-06-25T00:22:37"
  45. ["centru"]=>
  46. string(9) "BUCURESTI"
  47. ["cod_eveniment"]=>
  48. string(2) "AR"
  49. ["descriere_eveniment"]=>
  50. string(26) "Sosit In Statia de Livrare"
  51. ["persoana_livrare"]=>
  52. object(SimpleXMLElement)#9 (0) {
  53. }
  54. ["observatii_livrare"]=>
  55. object(SimpleXMLElement)#7 (0) {
  56. }
  57. ["motiv"]=>
  58. object(SimpleXMLElement)#8 (0) {
  59. }
  60. }
  61. [3]=>
  62. object(SimpleXMLElement)#5 (7) {
  63. ["data_eveniment"]=>
  64. string(19) "2014-06-24T20:05:48"
  65. ["centru"]=>
  66. string(7) "CRAIOVA"
  67. ["cod_eveniment"]=>
  68. string(2) "DF"
  69. ["descriere_eveniment"]=>
  70. string(17) "Plecat din Centru"
  71. ["persoana_livrare"]=>
  72. object(SimpleXMLElement)#8 (0) {
  73. }
  74. ["observatii_livrare"]=>
  75. object(SimpleXMLElement)#7 (0) {
  76. }
  77. ["motiv"]=>
  78. object(SimpleXMLElement)#9 (0) {
  79. }
  80. }
  81. [4]=>
  82. object(SimpleXMLElement)#6 (7) {
  83. ["data_eveniment"]=>
  84. string(19) "2014-06-24T18:31:25"
  85. ["centru"]=>
  86. string(7) "CRAIOVA"
  87. ["cod_eveniment"]=>
  88. string(2) "CI"
  89. ["descriere_eveniment"]=>
  90. string(22) "Receptionat in depozit"
  91. ["persoana_livrare"]=>
  92. object(SimpleXMLElement)#9 (0) {
  93. }
  94. ["observatii_livrare"]=>
  95. object(SimpleXMLElement)#7 (0) {
  96. }
  97. ["motiv"]=>
  98. object(SimpleXMLElement)#8 (0) {
  99. }
  100. }
  101. }


Ten post edytował pabito 28.06.2014, 14:59:31
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: 23.08.2025 - 04:00