mardi 26 mai 2020

Print specific data into a web page using php

This is the result of Solr engine,I tried to decode it and convert it to an array Now I have an array in this format and I want to display each value of each products on a web page Each products have a name, marque and categorie as features. When I tried to loop trought it using foreach I got empty result. and here is my array:

array(5) {
  ["_version_"]=>
  array(7) {
    [0]=>
    float(1.6666659645964E+18)
    [1]=>
    float(1.6666659646163E+18)
    [2]=>
    float(1.6666659646173E+18)
    [3]=>
    float(1.6666659646184E+18)
    [4]=>
    float(1.6666659646194E+18)
    [5]=>
    float(1.6666659646205E+18)
    [6]=>
    float(1.6666659646236E+18)
  }
  ["categorie"]=>
  array(7) {
    [0]=>
    array(1) {
      [0]=>
      string(7) "Bonbons"
    }
    [1]=>
    array(1) {
      [0]=>
      string(7) "Bonbons"
    }
    [2]=>
    array(1) {
      [0]=>
      string(7) "Bonbons"
    }
    [3]=>
    array(1) {
      [0]=>
      string(7) "Bonbons"
    }
    [4]=>
    array(1) {
      [0]=>
      string(7) "Bonbons"
    }
    [5]=>
    array(1) {
      [0]=>
      string(7) "Bonbons"
    }
    [6]=>
    array(1) {
      [0]=>
      string(7) "Bonbons"
    }
  }
  ["id"]=>
  array(7) {
    [0]=>
    string(36) "64678881-ed19-47cf-aaf5-877d7b45a6c7"
    [1]=>
    string(36) "4abb6b91-5e03-44ef-b728-a7f900e7a9f8"
    [2]=>
    string(36) "0d6380fd-b7b9-4447-ba7f-bbb032e4c5be"
    [3]=>
    string(36) "3e21b671-5d0b-4c01-8f8f-3b3f4c14ea4f"
    [4]=>
    string(36) "8865f4a6-f6b3-40f7-ad74-a15fdda62c4f"
    [5]=>
    string(36) "a4a11941-02fc-473b-8d42-87b890e2b141"
    [6]=>
    string(36) "92d8adde-1805-4bcc-8aaf-52aafad783c0"
  }
  ["marque"]=>
  array(7) {
    [0]=>
    array(1) {
      [0]=>
      string(6) "MENTOS"
    }
    [1]=>
    array(1) {
      [0]=>
      string(6) "MENTOS"
    }
    [2]=>
    array(1) {
      [0]=>
      string(6) "MENTOS"
    }
    [3]=>
    array(1) {
      [0]=>
      string(6) "Mentos"
    }
    [4]=>
    array(1) {
      [0]=>
      string(6) "MENTOS"
    }
    [5]=>
    array(1) {
      [0]=>
      string(6) "MENTOS"
    }
    [6]=>
    array(1) {
      [0]=>
      string(6) "MENTOS"
    }
  }
  ["nom"]=>
  array(7) {
    [0]=>
    array(1) {
      [0]=>
      string(29) "Bonbons parfums fruits MENTOS"
    }
    [1]=>
    array(1) {
      [0]=>
      string(21) "Bonbons menthe MENTOS"
    }
    [2]=>
    array(1) {
      [0]=>
      string(37) "Bonbons caramel/chocolat blanc MENTOS"
    }
    [3]=>
    array(1) {
      [0]=>
      string(31) "Bonbons caramel/chocolat MENTOS"
    }
    [4]=>
    array(1) {
      [0]=>
      string(28) "Bonbons menthe sucres MENTOS"
    }
    [5]=>
    array(1) {
      [0]=>
      string(31) "Bonbons framboise orange MENTOS"
    }
    [6]=>
    array(1) {
      [0]=>
      string(26) "Bonbons pomme verte MENTOS"
    }
  }
} 

How can I get that?




Aucun commentaire:

Enregistrer un commentaire