Welcome Guest, Not a member yet? Register   Sign In
Conditional in a Foreach
#1

[eluser]skribe[/eluser]
Hi:

I have some code that produces a list of people attached to a project as part of the client view. It cycles through the projects and lists the people. Unfortunately I can't figure out a way to test if nobody is attached to the project.

Any suggestions?

Code:
$person=array();
foreach($projects as $project):
    $person = array($project->id => $project->name);
    foreach($person as $id => $name):
         $per[]=anchor('person/view/'.$id,$name);
    endforeach;
<more code>
endforeach;


Messages In This Thread
Conditional in a Foreach - by El Forum - 02-22-2011, 03:55 AM
Conditional in a Foreach - by El Forum - 02-22-2011, 04:22 AM
Conditional in a Foreach - by El Forum - 02-22-2011, 04:26 PM
Conditional in a Foreach - by El Forum - 02-22-2011, 10:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB