Development

David Carr

Cases where php's short tags should be avoided

When designing my email layout files I like to break them down into parts and include them together as needed using includes. I've stumbled across a display issue when using a short tag include:

<?=include('Layouts/Header.php');?> 

This caused a 1 to be displayed where the file is being included. Which when you think about it kind of makes sense since short tags are meant for simple variable output and not a chunk of HTML. So when run they are essentially booleans (true) to avoid this I stopped using short hand:

<?php include('Layouts/Header.php');?>

 

Domains are often purchased from multiple providers, keeping track of where a domain is and its DNS settings can be tricky. Domain Mapper solves this by listing all your domains in one place. View your DNS settings and receive reminders to renew your domains. Try it today.

Support my work by donating with PayPal.

Subscribe to my newsletter

Subscribe and get my books and product announcements.

© 2009 - 2021 DC Blog. All code MIT license. All rights reserved.