View Single Post
Old Oct 28th, 2005, 10:13 AM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
PHP has a propensity to produce a LOT of its data in arrays. There are alternatives (objects, for instance), but arrays are extremely common. After all, that's what a row in a database table essentially IS: an associative array.

A clue to why you might want to write a function lies it it's name: function. Perhaps you never thought of it like that. Connecting to a database is a function. Emitting an HTML table of a certain structure, over and over, is a function. Why mix the two? They're not related. Scrambled eggs are for breakfast, not applications.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote