while(fetching){
if($x != $y){
echo "<div> Something </div>
<div>";
}
$x = $y;
echo "<div> Something Else </div>";
if($x != $y) {echo "</div>";} //The Problem Here
}
In my code here, I can't close my element at all, All the elements above the ending are combined inside each other and the element is closed at the end of all of it, How can i fix that? i tried going
if($x != $y){
echo "<div> Something </div>
<div>}
$x = $y;
echo "<div> Something Else </div>";
}
if($x != $y) {</div>";}
but didn't work either.
What i'm trying to accomplish is
<div> Something </div>
<div>
<div> Something Else </div>
<div> Something Else </div>
</div>
<div> Something </div>
<div>
<div> Something Else </div>
<div> Something Else </div>
</div>
What always happens is
<div> Something </div>
<div>
<div> Something Else </div>
<div> Something Else </div>
<div> Something </div>
<div>
<div> Something Else </div>
<div> Something Else </div>
</div>
</div>