How to echo this array? |
Hi guys,
I send an array $data['content'] into view. and here are the content of this array. Code: array(2) { Now how to echo 'subject_name' and 'author' using foreach?
Well your question is a bit unclear. $data['content'] is the array $data with an element 'content'. Is the array you have shown the element 'content' or the array $data itself?
In your controller something like: PHP Code: public function index() In your 'homepage.php' view file something like: PHP Code: <?php if ( ! empty($content)) { ?> I hope that helps but perhaps you were asking something more complicated that I have missed. Best wishes Paul. |
Welcome Guest, Not a member yet? Register Sign In |