Welcome Guest, Not a member yet? Register   Sign In
Arrays
#1

[eluser]Milos[/eluser]
Hi, all.

I am doing video tutorials, and I can't find any info about strange uses of arrays here.

I can give you an example:

// this is the code from controller:

$data['name'] = "Milos";

// i transfer the $data to the view

$this->load->view('home', $data);

// this is the code from the view

<?php echo $name; ?>

So this is the thing that I do not understand.
We have an array $data and 'name' is just a string index for that array.
How can I access it like $name - normally it should be $data('name');
I didn't find any example like it in PHP manual so I don't know what is this.
Thanks,

Milos


Messages In This Thread
Arrays - by El Forum - 12-24-2010, 07:26 AM
Arrays - by El Forum - 12-24-2010, 07:52 AM
Arrays - by El Forum - 12-24-2010, 08:00 AM
Arrays - by El Forum - 12-24-2010, 08:48 AM
Arrays - by El Forum - 12-24-2010, 09:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB