Implicit Evaluation with PHP Archives: PHP
next page · previous page
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
26 September 2006
Variable Numbers of Arguments in PHP
There is a problem which infrequently appears in nearly every programming language: calling a function with a variable number of arguments. It is interesting from both sides of development: if you’re writing a function, how will you collect variable numbers of arguments? If you’re consuming a function, how will you provide the arguments?
Much of the […]
continue reading... » 0 Comments
18 September 2006
A Viewstate for PHP
One of ASP.net’s most attractive features is the viewstate. It is a convienent way to store arbitrary data in a persistent mechanism. In fact, it’s rather like PHP’s $_SESSION array.
There is, however, one difference. $_SESSION is unique to a user but is reused across pages. With only one window to your website, the two preform […]
continue reading... » 0 Comments
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
29 August 2006
PHP Parsing HTML
One of the higher level items I seem to deal with frequently is HTML parsing. The primary reason that HTML gets elected as a data format over something like CSV is that it’s easy to style. CSV lacks any formatting at all. XLS is beautiful, but essentially impossible to parse without a COM friendly language, […]
continue reading... » 0 Comments
23 August 2006
Official Introspection, Reflect and Implicit Evaluation PHP.net resources
PHP.net actually provides documentation for each of these topics, but finding it can prove difficult. The following is a collection of the links I’ve discovered.
PHP5 Reflection Classes: These are explicit reflection methods specific to PHP5. I’ve never used them.
Object introspection functions: Introspection functions. There are slight differences in some between PHP4 and PHP5.
Zend Debugger Extensions: […]
continue reading... » 0 Comments
21 August 2006
Variable representation in PHP
In PHP, I like to think each function has its own Dictionary/Hash to manage its scope and that code outside of functions is actually part of a “Main” function. I think of it as a dictionary because through implicit evaluation, you can create variables with spaces and other reasons you’ll see at the conclusion of […]
continue reading... » 0 Comments
17 August 2006
Using HTML as a Template
There are roughly three ways I can think of offhand to do templating in PHP.
HTML Tags with PHP to populate values
PHP Functions to generate tags including values
Special markup to do one or more of the above
There are relatively concrete examples of each. Any new programer, and even some experienced programmers use method 1. Indications of […]

