Alex
Alex

Reputation: 1073

<?php and <?= tags in PHP templates

I am learning to build a templating system. In the view folder i have a page that has this code

Hello <?= $data["name"]; ?>

If i enter this page I see that the code works just with <?= ?> tags. I tried <?php ?> but it doesn`t work. I thought that the tags have the same functionality. What is the explanation ?

Upvotes: 0

Views: 63

Answers (1)

baao
baao

Reputation: 73301

That's a shortener for

<?php echo $data['name']; ?> 

Upvotes: 4

Related Questions