|
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.
|