// archives

code

This tag is associated with 2 posts

Zend Framework and File Locking Pitfalls

Earlier today while reading through the Zend Framework 1.6 RC1 release notes I've come across an interesting bug that has been fixed: [ZF-3382] Zend_Cache_Backend_File problems under very high load.
There are a lot of things to say about this issue. The obvious ones first:
1. Under typical operation such as opening, locking, reading/writing, and then closing a […]

Handling CSV data with PHP the Smart Way

Let's assume we have a file "users.csv", containing the following data:

"Username","Firstname","Lastname","Age"
"johndoe","John","Doe","21"
"hmiller","Hank","Miller","35"

Processing the data in PHP is rather straight forward, by simply using fgetcsv(). Let's display the user's name and age:

// open the file for reading
$f = fopen('users.csv', 'r');

// just a dummy read to get the header out of the way
fgetcsv($f);

// loop through each line
while ($data […]

Did You Know?

During my quest to delve more into game programming, I came across the demo Second Reality by Future Crew, which got me interested in electronic music. The first app I used was the Future Crew's ScreamTracker 3. A few months later I turned to Jeffrey Lim's Impulse Tracker. Years later I found out about Propellerheads' Rebirth, but the software that finally rekindled my interest was Reason 2.5.