Welcome Guest, Not a member yet? Register   Sign In
Iterate over a DB function, JSON_ARRAY in CI4
#3

Hi, I've managed to solve this problem, below is my code. Hope it helps somebody

<?php foreach ($value as $i=>$vals): ?>
<?php foreach(json_decode($vals) as $x=>$y):?>
<?= $y ?>
<?php endforeach ?>
<?php endforeach;

First I iterated over the Json array as my question asked, and on the Second Iteration, I managed to get the VALUES of the First iteration. Anyways if there is a more elegant way to do this, Ill gladly accept any suggestions. Smile
Thanks.
Reply


Messages In This Thread
RE: Iterate over a DB function, JSON_ARRAY in CI4 - by samaidha - 02-20-2022, 11:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB