Subprograms instead of Functions
Date: 08/10/06
(PHP Community) Keywords: php
I want to repeat some code in different sections of a PHP script, without having to pass varibles as you do a function. These were called "Subprograms" in BASIC.
I could just:
* Copy+paste multiple copies of the code
* Make a small php file with the code & include() the file where I want it
* Copy the code to a string and get PHP to eval() it
* Use GOTO as in the good 'ole BASIC days :D
... but those seem such dirty ways to do it (that frankly, I would never use). No joy searching the manual.
Anybody done this before?
Source: http://community.livejournal.com/php/480848.html