Category Archives: PHP

It’s Not True that PHP Arrays are Copied by Value

PHP, Arrays & Passing by Reference Do you know that objects in PHP5 are passed by reference, while arrays and other scalar variables are passed by value? Yes, you know it, but it’s not exactly true. Let’s see some example … Continue reading

Posted in PHP, zend framework | Tagged , , , , , | 3 Comments

PHP and MySQL Natural Sort

Use Case Let’s say we have an array of data represented by some text followed by a number. Just like the movies from a movie series like “Mission Impossible” or “Pirates of the Carribean”. We know that they are often … Continue reading

Posted in micro tutorial, PHP | Tagged , , , , , , , , , , , | 1 Comment

PHP Strings Don’t Need Quotes

I bet you didn’t know that PHP strings don’t need quotes! Indeed PHP developers work with strings with either single or double quotes, but actually in some cases you don’t need them. PHP by Book Here’s how PHP developer declare … Continue reading

Posted in PHP | Tagged , , , , , , , , , , , , , | 13 Comments

Computer Algorithms: Insertion Sort

Overview Sorted data can dramatically change the speed of our program, therefore sorting algorithms are something quite special in computer science. For instance searching in a sorted list is faster than searching in an unordered list. There are two main … Continue reading

Posted in algorithms, PHP | Tagged , , , , , , , , , , , , , , , , | 1 Comment

How to Dump the Generated Zend_Db SQL Query

The Typical PHP Approach Typically a PHP programmer will write his SQL query as a string and will execute it via mysql_query. $sql = "SELECT * FROM my_table"; $resource = mysql_query($sql); So eventually when you want to dump this “complex” … Continue reading

Posted in PHP, zend framework | Tagged , , , , , , , , , , | Leave a comment