MariaZ
MariaZ

Reputation: 1747

Inserting php output in an html file

I saw some html that displays the results of a PHP code just by adding {#name}

<html>
  <body>
     {#name}
  </body>
</html>

How can i do that?

I have been looking around and I cant find anything that shows me how to do this. Thanks!

Upvotes: 1

Views: 83

Answers (2)

Jonathon Reinhart
Jonathon Reinhart

Reputation: 137398

What you saw was probably some sort of template system. If that is the case, the PHP script reads the template, and then replaces all instances of {#name} with the contents of the variable $name.

An example of one such template system would be Smarty.

Upvotes: 4

Benjamin Gruenbaum
Benjamin Gruenbaum

Reputation: 276286

<?=$name?>

where name is your php variable

Upvotes: 1

Related Questions