This question already has an answer here:
How to echo the image if(isset($post->foto)
inside the code below? I am trying with the below code but I can't find any solution. Its returning the following error
Parse error: syntax error, unexpected 'userdata' (T_STRING), expecting ',' or ';'.
foreach($postimet as $post){
$firstname = $user->getUserById($post->userid)['first'];
$lastname = $user->getUserById($post->userid)['last'];
foreach($fotos as $foto){
echo
"<div class='po_001'>
<div class='po_004'>
<img src='timeline/".$foto."' class='po_003'>
<div class='po_005'>
<a href='profile.php' class='po_002'>$firstname $lastname</a>
</div>
<div class='po_006'>
<span class='p_007'>$post->posttime</span>
</div>
</div>
<div class='po_008'>
<p class='po_009'>$post->message</p>
</div>
<div class='po_010'>
if(isset($post->foto))
{
<img class='myimage'src='"userdata/".$post->foto->imagename."'>
}
</div>
</div>";
}
}
</div>