Unknown PHP Iterating through multiple arrays and fetching string values from array[1] gives error | Code Solutions | My Project HD
X

PHP Iterating through multiple arrays and fetching string values from array[1] gives error

PHP Iterating through multiple arrays and fetching string values from array[1] gives error





PHP Iterating through multiple arrays and fetching string values from array[1] gives error

I want to iterate through this JSON response that I have converted into a PHP array for better understanding.


$data variable holds the following response. What would be the correct way to loop through the second array that is 1 => array( 0 => 'abc' and so on...



I have tried this method for iteration. added some checks to loop through inner arrays.



getting this error in return.

Warning: Trying to access array offset on the value of type int in

Solution Answer

in this code some changes needed Like


1.Please Use $key Instead of $values in if condition



More Tutorials

Web Technology Tutorials in Hindi

Web Technology Tutorials in Hindi

Read More
Diploma engineering tutorial for polytechnic collage

Diploma Engineering Tutorial

Read More
Final Year Projects for Computer Science with Source Code

Final Year Projects for Computer Science with Source Code

Read More