Snips
4. Drop those Brackets

Dropping brackets saves space and time in your code.
Much like using shortcuts when writing else functions, you can also save some characters in the code by dropping the brackets in a single expression following a control structure. Evolt.org has a
handy example
showcasing a bracket-less structure.
if
(
$gollum
==
'halfling'
) {
$height
--;
}
This is the same as:
if
(
$gollum
==
'halfling'
)
$height
--;
You can even use multiple instances:
if
(
$gollum
==
'halfling'
)
$height
--;
else
$height
++;
if
(
$frodo
!=
'dead'
)
echo
'Gosh darnit, roll again Sauron'
;
foreach
(
$kill
as
$count
)
echo
'Legolas strikes again, that makes'
.
$count
.
'for me!'
;
7. Memcached

Memcached is an excellent database caching system to use with PHP.
While there are tons of caching options out there,
Memcached
keeps topping the list as
the most efficient for database caching
. It’s not the easiest caching system to implement, but if you’re going to build a website in PHP that uses a database, Memcached can certainly speed it up. The caching structure for Memcached was first built for the PHP-based blogging website LiveJournal.
PHP.net has an excellent tutorial on
installing and using memcached
with your PHP projects.

