I am trying to pass html (image tag) inside an array_push:
array_push($result, array("id"=>$value, "label"=>'<img src="images/image.jpg" alt="">'.$value, "value"=>strip_tags($key)));
The problem is that the html is rendered in the page like this:
<img src="images/image.jpg" alt="">
so I get just text:
<img src="images/image.jpg" alt="">
instead of an image.
I process the array $result with json_encode:
echo json_encode($result);