samedi 11 août 2018

Iterate a json array and extract same field from each json object

I have a json array $data['client']->client_details->client_ratings which I am trying to iterate and print out a particular field value from each json object in that array. Below is the code I have in my php class but it is giving me error?

<div class="tab-pane" id="text">

   <p>

      <span class="heading_size">text:</span>

   </p>

   <p class="text-justify mb-0 pb-5">

      for($i=0; $i<count($data['client']->client_details->client_ratings); $i++) {

        <?php echo strtolower($data['client']->client_details->client_ratings[$i]->client_review->details); ?>

      }

   </p>

</div>

I am getting error as undefined i variable. What is wrong I am doing here?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire