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

[eluser]duellsy[/eluser]
Perhaps this?
Code:
$person=array();
foreach($projects as $project):
    $person = array($project->id => $project->name);
    $per = array();
    foreach($person as $id => $name):
         $per[]=anchor('person/view/'.$id,$name);
    endforeach;
    if(sizeof($per) == 0):
        // project has no people... do something about it
    endif;
<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