CodeIgniter Forums
print_r() is not showing anything? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: print_r() is not showing anything? (/thread-54395.html)



print_r() is not showing anything? - El Forum - 09-07-2012

[eluser]solid9[/eluser]
I'm trying to display the values of $data,

Code:
function index(){
$data['posts'] = $this->MPosts->getLivePosts(10);
$data['cats'] = $this->MCats->getTopCategories();
$data['title'] = "Welcome";
$data['main'] = 'public_home';

echo '<pre>';
print_r($data);
echo '</pre>';  

echo "test, test, test...";
/*
$this->load->vars($data);
$this->load->view('template');
*/
  
  }

By the way I'm using TeamViewer and when I refresh the page.
I don't see the $data array.

I also don't see any error.
just the default page.

What could be the problem?





print_r() is not showing anything? - El Forum - 09-07-2012

[eluser]Otemu[/eluser]
I copied your code above removing 'posts' and 'cats' array and the print_r works fine. Is there anyway you can test it without using TeamViewer??