Cant request array results - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Cant request array results (/showthread.php?tid=9072) |
Cant request array results - El Forum - 06-10-2008 [eluser]Rubiz'[/eluser] Hello all!! Well I have a PHP question... I recorded an array, and I print_r this, the result is: Code: Array ( [message] => Array ( [0] => Imagem: 2_1.gif inserida com sucesso! I forgot how to request this in view... I tried this way: Code: <? if(isset($messages)): ?> But if doesnt work... anyone knows the right way? Cant request array results - El Forum - 06-10-2008 [eluser]Michael Wales[/eluser] It appears as if your array is named $message, not $messages. EDIT: Nevermind, early in the morning for me. I would just do: Code: foreach ($messages['message'] as $message => $id) { Not seeing all of your code I am curious as to why you are using a multi-dimensional array here though... Cant request array results - El Forum - 06-11-2008 [eluser]saidai jagan[/eluser] yeah use a for each it ll be easy to fix it Cant request array results - El Forum - 06-11-2008 [eluser]Rubiz'[/eluser] I used it, its is right now, thanx!! Well actually I recorded an array inside a result array, so, of course I would have to make a foreach rsrsrs. I'm so "silly" sometimes. I needed to controll result so I made a foreach, switched to a for, and it is working!! Thanx guys! PS: Saidai, I loved your profile picture !! Cant request array results - El Forum - 06-11-2008 [eluser]saidai jagan[/eluser] thanx buddy :red: |