I'm attempting to print an array of php elements embedded in html
If I input
echo '<strong>'.$s[firstname].' '.$s[lastname].'</strong><div class="moreinfo"><p><small>'.$s[role].' of '.$parent'.</small></p></div></li>';
I get a result that says something like "Chris James Parent of Array
but if I attempt to print the array with a foreach as so
echo '<strong>'.$s[firstname].' '.$s[lastname].'</strong><div class="moreinfo"><p><small>'.$s[role].' of '.
foreach($parent as $p){
echo $p.' ';
}
.'</small></p></div></li>';
The program crashes completely. I would assume that I'm doing something syntactically incorrect, but I can't spot the issue. Is there a simply way to print the elements in thearray that would avoid the crash?
Thanks in advance!
firstnameandlastnameare defined constants, then they should be quoted in$s['firstname']and$s['lastname']