Latest articles under PHP category

Using PHP Variable Variable.

I’ve known the concept of PHP’s variable-variable from when I start working with PHP years ago. I thought it’s a neat feature that I’m not sure what, if any, it is useful for. Just recently, I found that it’s actually useful for me while generating XML using SimpleXML. If you’ve never heard about variable-variable, then [...]

Posted on March 27th, 2009 under PHP  •  No Comments

Adding script name on SQL queries

Have you ever done SHOW FULL PROCESSLIST on MySQL and found that there are some queries that has been running for a long time? Then you tried to find out from where the query was initiated so that you can debug those script only to find out that there are many similar queries from different [...]

Posted on February 10th, 2009 under General SQL, PHP  •  1 Comment

Analyzing data in Unix using PHP CLI.

There are times when I need to quickly gather some quick data in a simple tab based or space based delimited file, most often log files. Also, the files that I work on are often huge, well according to my standard at least … about 1GB. The data that I need is often simple statistics [...]

Posted on February 4th, 2009 under General Unix, PHP  •  No Comments

Computing degrees of separation in social networking.

As the final question in one of my interviews a while ago, I was asked to compute the average degrees of separation in social networking site. If you don’t know what degree of separation, here’s an example.
Amy is a friend of Robert. Therefore, Amy and Robert are 1st degree friend. Robert is a friend of [...]

Posted on January 9th, 2009 under General / Algorithm, PHP  •  3 Comments

Page 2 of 2«12