Implicit Evaluation with PHP

Implicit Evaluation with PHP Archives: Tutorial

· previous page

20 November 2006

Dynamic Image Generation in PHP

Through use of the GD libraries, it’s long been possible to write images in code with PHP. They’re unlikely to be photographic quality, but for captcha’s, counters, charts, etc, it’s unlikely that it needs to be. But this particular feature seems to be generally overlooked. PHP: Dynamic Image Generation is a nice tutorial for using […]

continue reading... » 2 Comments

24 October 2006

Session Management in PHP

Session management is one of the features that sets PHP apart from other languages which happen to be used on the web. It is easy enough to understand how to use $_SESSION, but many programmers seem to learn how to use it and nothing more.
$_SESSION serves a single, useful purpose. It makes variables available across […]

continue reading... » 0 Comments

2 October 2006

PHP and Perl Comparison

Today’s post is more practical than usual. A few weeks ago, I discovered a functional comparison between PHP and Perl authored by Professor Alva Couch of Tufts University. It struck me as a very useful resource, so I updated the PHP column to PHP5 (it was PHP3) and added all the function documentation I could […]

continue reading... » One Comment

27 September 2006

Tail Recursion in PHP

There are two types of recursion in the world: tail recursive and non-tail recursive. Non-tail recursive is the more obvious of the two and is used frequently. For instance, when dealing with any kind of hierarchical data (that which is expressed in a tree data structure) a recursive call is likely used to construct the […]

continue reading... » One Comment

14 September 2006

Objects and Arrays in PHP

In PHP, Objects and Arrays are very similar. Objects can easily be cast as an array with get_object_vars, and a simple foreach loop can easily construct an stdObject from an array. Their similarities mean there is little you can do with one that you cannot do with the other. Some of the differences (at first […]

continue reading... » One Comment

1 May 2006

Accessing Multi-dimensional Array

This weekend, I got an email from a reader wondering how to access non-constant indices of a multidimensional array.
Given an HTML field like <input name=”users[username][email]” type=”text” />
He needed to know how to access it. After trying multiple things, the solution he found was:
$property = “[username][email]”;
$field = $_POST[”users”];
$result = eval (”$field$property;”);
The more obvious $result = […]

continue reading... » 0 Comments

8 March 2006

PHP Help: get_defined_vars - PHP Manual

This is the kind of function that makes me love PHP.
Read more at www.phpfreaks.com/phpma…

continue reading... » 0 Comments

· previous page