Php in html code

Discuss coding issues, and scripts related to PHP and MySQL.
mlucicom
Posts: 34

Php in html code

Hello,
have you any ideea how this work in html without <?php ?> tags?

Code: Select all

<div class="modal-title">{$lng->people_who_like_this}</div>

Admin
- The form of the code that you posted it can work with a template system, like php Smarty, which must be included and configured in your php script.
Otherwise, the php code (variables, functions) have to be in <?php tag to can be interpreted by php server.
So, it can work in this way, in php file:

Code: Select all

<div class="modal-title"><?php echo $lng->people_who_like_this; ?></div>
Or like this:

Code: Select all

<?php echo '<div class="modal-title">'. $lng->people_who_like_this .'</div>'; ?>

Similar Topics