I am sending preformatted HTMl with AJAX JSON, JSON have below code,
I am trying pull data array from DB and echoing array data, I am not able to put foreach loop in json_encode, because seems my code is wrong at foreach loop,
How can i achieve that?
echo json_encode(array('returnnews' => '<div class="news-item-page">
<h3 class="text-info" style="margin-top:0">'.$latestnews->news_subject.'</h3>
'.$latestnews->news_content.'
</div>
<div class="row">
<div class="col-md-6">
<ul class="list-inline blog-tags">
<li>
<i class="fa fa-tags"></i>'.
foreach($news_tag_array as $tag){
<a href="javascript:;">
echo $tag </a>
}
</li>
</ul>
</div>
</div>'));