Understanding Alternative syntax for control structures in PHP

Sometimes you wind up working on a page that switches back and forth between php and html. It can be tricky keeping track of code or making the mistake of over using the echo function. Luckily php supports an alternative syntax for control structures allowing you to jump in and out of php and html. Any code (html, php, anything) nested within a conditional will only parse if the defined conditions are matched. The end result is clean, organized, efficient code.

One of my interns once put all his html code into an array and printed each part while looping through function calls. It worked, but it his source code was so hard to read that when I asked him to take a look at it a few months later he couldn’t even make sense of what he wrote.

PHP’s alternative control structure syntax makes it easy to identify code blocks and it’s widely used in many popular open source projects.

Read more

Sometimes you wind up working on a page that switches back and forth between php and html. It can be tricky keeping track of code or making the mistake of over using the echo function. Luckily php supports an alternative syntax for control structures allowing you to jump in and out of php and html. Any code (html, php, anything) nested within a conditional will only parse if the defined conditions are matched. The end result is clean, organized, efficient code.

One of my interns once put all his html code into an array and printed each part while looping through function calls. It worked, but it his source code was so hard to read that when I asked him to take a look at it a few months later he couldn’t even make sense of what he wrote.

PHP’s alternative control structure syntax makes it easy to identify code blocks and it’s widely used in many popular open source projects.

Read more

Stamen’s new basemaps are beautiful

Stamen recently released a set of free open source web mapping services that are both fast and beautiful. Watercolor (my favorite) is a great map service for anyone looking to add some artistic flare to their maps. The basemap incorporates hand-painted brush textures and high-level cartographic algorithms to create a map that honestly looks like … Read more