• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Array value

#1
[eluser]Ninja[/eluser]
I have an array that gets all clients ids from the client table as the index and companynames from the company table as the value but i need to display only the value (.ie the companyname for each client)

Controller
Code:
foreach ($parents->all as $parent)
        {
            $id = $parent->parent_client;
            $parent->company->get('id, companyname');
            $name = $parent->company->companyname;
        
            $data['parent'][$id] = $name;
        }

View
Code:
<?=$parent ?>
This displays 'Array' (naturally) i tried using another foreach in the view but that displayed all the clients

i know the array is fine because i used a print_r to check it.

How can i display only the value for each element in the array?
Please help..


Messages In This Thread
Array value - by El Forum - 07-17-2009, 03:15 AM
Array value - by El Forum - 07-17-2009, 03:42 AM
Array value - by El Forum - 07-17-2009, 03:59 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.