I am Hack Sparrow
Captain of the Internets.

How to manhandle XML with namespace in PHP

You might agree that handling XML is already a fuckin pain in the ass! There are so many cumbersome ways of handling XML in PHP, you don't have a clue which one to use and how the fuck they work anymore. Then one beautiful day you get an XML which looks like this monster: [xml] <?xml version="1.0" encoding="UTF-8"?> <aws:SitesLinkingInResponse xmlns:aws="http://alexa.amazonaws.com/ ...

iName – PHP Function to Format and Generate iProduct Names

The iName is a commercial PHP function used for formatting and generating product names which comply to the iProduct naming convention. According to the iProduct naming convention, the name of the product should be prefixed with a lowercase "i" followed immediately by the capitalized normal name of the product. The iProduct naming convention was pioneered by Steve Jobs at Apple. Examples of products which comply to the iProduct naming convention: iMac iPhone iCamera ...

Turning on PHP Error Reporting – PHP error_reporting()

PHP error_reporting has a changeable value of 'PHP_INI_ALL', which means you can set the value anywhere in the system. To turn on PHP Error Reporting in your PHP file add this at the top of the file: [php] ini_set('display_errors', 1); error_reporting(E_ALL | E_STRICT); [/php] The same can be achieved using the .htaccess file. To turn on PHP Error Reporting using .htaccess file add this in your .htaccess file: [code] php_fla ...

Solution to PHP imap_open Invalid Certificate Failure (Self-signed certificate or untrusted authority)

When you try to do this: [php] $mbox = imap_open('{mail.domain.com}INBOX', 'user@domain.com', 'userpass'); [/php] You get this warning: Warning: imap_open() [function.imap-open]: Couldn't open stream {mail.domain.com:143}INBOX in E:\Projects\mailer\main.php on line 4 Notice: Unknown: Certificate failure for mail.domain.com: Self-signed certificate or untrusted ...

Why not to use PHP short opening tags

The short answer is "NO, you should not". The reason why you should not use PHP short tags is explained below. Your hosting server may not support short opening tags (<?). After spending hours on development on your development server (localhost?), when you upload the code online, you will find everything is broken. If you are shari ...