Insert image in echo line - PHP

100
January 31, 2019, at 01:20 AM

Maybe this is to simple for you but...Not to me :(

I need to put some small icon right before the sentence printed by this line:

echo "<p class='woopr-product-message'>".$message."</p>";

The sentence show by this code is:

Buy now and get X points

Any idea how to achieve that? Thank you.

Answer 1

Just simple add code before variable

<?php
    $message = "Hello World";
    echo "<p class='woopr-product-message'><img src='https://number-1.es/wp-content/uploads/2018/11/icon-address-grey.png' /> ".$message."</p>";
?>

or using fontawesome icon

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.0/css/all.css">
<?php 
    $message = "Hello World";
    echo "<p class='woopr-product-message'><i class='fas fa-home'></i> ".$message."</p>";
?>
READ ALSO
Php regular expression echo characters after a string

Php regular expression echo characters after a string

I have a largetxt file, within the

118
WP user frontend submit product form with custom fields

WP user frontend submit product form with custom fields

I'm using a WordPress user frontend to create a page where users can publish a product

160