1

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!

2
  • 4
    probably used together with a templating system... Commented Jun 20, 2012 at 23:36
  • 2
    That's not PHP, so it must be part of a templating system that happens to use PHP. Commented Jun 20, 2012 at 23:36

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

Comments

1
<?=$name?>

where name is your php variable

1 Comment

Note that this requires either PHP 5.4, or that short_tags be On in the PHP configuration.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.