PHP

From WhyNotWiki

Jump to: navigation, search

Contents

[edit] Reference links

[edit] Conventions

is_null($x) or isset($x) or $x=== null or $x== null or just plain $x ??

[edit] Exceptions (PHP 5)

http://wiki.ciaweb.net/yawiki/?area=PEAR_Dev&page=RfcExceptionUse

http://devzone.zend.com/node/view/id/666 Zend Developer Zone | Exceptional Code - PART 1

[edit] Notes/Snippets

[edit] Timezones

<?php
echo date_default_timezone_get() . "\n";
echo date('m/d/Y g:i A e', time()) . "\n";

date_default_timezone_set('US/Eastern');

echo date_default_timezone_get() . "\n";
echo date('m/d/Y g:i A e', time()) . "\n";
?>

America/Los_Angeles
08/24/2006 1:27 PM America/Los_Angeles
US/Eastern
08/24/2006 4:27 PM US/Eastern

[edit] Unit testing

http://www.lastcraft.com/simple_test.php

[edit] Templating frameworks/languages

http://www.megginson.com/blogs/quoderat/2005/06/11/rails-vs-php-mvc-or-view-centric/. Retrieved on 2007-05-11 11:18.

Smarty is a behemoth, but since PHP is itself a template language, all you really need is something to separate out your view logic. Savant (http://phpsavant.com/) is great for this, and it uses PHP itself as the template language, so it’s lightweight and very fast.

Retrieved from "http://whynotwiki.com/PHP"
Personal tools