20/11/2007
The commonly used
$this->getRequestParameter('blah')
is a shortened version of
$this->getRequest()->getRequestParameter('blah')
All sorts of other goodies are available using $this->getRequest(), including for example:
$this->getRequest()->getPathInfo()
11/10/2007
Use the letter i after the ending delimiter. For example:
preg_match("/^TMG-[A-Z]-([0-9]+)/i",$itemNumber)
9/11/2006
The solution is to use session_set_cookie_params() to allow any subdomain to access the session:
session_set_cookie_params (86400,'','.yourdomain.co.uk');
session_start();
Note the dot before the domain name. session_set_cookie_params() must be called before session_start(), and must be called on every request.
6/11/2006
The SQL parser in PHPMyAdmin 2.6.x (the version used in Plesk 7.5) falls over when confronted with an ISNULL query, for example:
SELECT ISNULL(id) FROM user
The bug is fixed in recent versions of PMA (2.9.x works fine).
24/08/2006
FeedCreator seems to be the best solution out there.
9/08/2006
Where we’d use print_r in PHP, use the inspect method in Ruby.
When using Rails, you can use the ‘debug’ method instead, which often gives more useful results.
2/11/2005
Only output a set number of whole words from a sentence:
$result = implode(' ',array_slice(preg_split('/\s/',$row['article']),0,35));
6/10/2005
If you need to stop PHP parsing short tags (<? without the php), for instance if you want to use an XML prolog in a page, pop this in an .htaccess file:
php_value short_open_tag off