I want to place an image tag inside a PHP array dynamically loaded from a database. The array will ultimately be displayed directly on the page.
What is the correct syntax for an image tag inside an array; that is, as soon as the array is displayed on the page, the image tag should be displayed as an image, and not as plain text.
Perhaps it would be easier if I show you what I mean:
foreach($rows as &$row) { $this->_rows[] = array( 'thumnail' => '<img style="width: 180px; height: 80px;" src="<?= THUMBNAILn_Assets::getProductThumbnail($row->id) ?>" />', ); };
The image tag displays plain text on the page, not the image.
source share