If you are familiar with PHP you will know that strings can be contained within single quotes or double quotes. More often than not developers tend to always use double quotes, despite the context of the string.
While this is OK in principle, double quotes take more processing time than that of single quotes (despite being minimal). This is because PHP expects to find variables within double quoted strings and parse them. Continue reading →
More often than not while writing in PHP, you will need to debug the code you have written and/or find out relevant information about classes. This tip outlines different debugging methods such as print_r, var_dump and error logging as well as useful class functions. Continue reading →
Is the following error familiar to you?
Fatal error: Allowed memory size of XXX bytes exhausted
It is to me, and recently I’ve written an import script that reads the contents of 10 XML files. These files accumulate a total of 14.9MB in size. The XML files contain page content (A good 10,000), each page has references to images and PDFs which needed to be downloaded, stored on the filesystem in the same directory structure as well as imported into an asset manager, again in the same structure. Once the assets have been downloaded the script stores the contents of the XML files. Continue reading →