Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The htmlentities issue isn't anything a little upstream logic couldn't fix; just the same as Django's templating engine does.

<?= $name ?> is my preferred method of printing inline, which shortens it up quite a bit.



Mine, too, although I usually do my escaping/encoding in the template itself, so it becomes:

  <?= h($name) ?>
Which isn't that terrible.

The PHP developers don't make this easy though, as "short tags" are officially recommended to be disabled, so to write portable PHP you'd have to do

  <?php= h($name) ?>
Every time, which adds visual noise that gets worse the more tags you write.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: