note 18964 deleted from functions.variable-functions by didou
| From: | didou@php.net | Date: | Mon, 04 Aug 2003 06:00:00 +0000 |
| Subject: | note 18964 deleted from functions.variable-functions by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-53294@lists.php.net to get a copy of this message | ||
Note Submitter: tboothby @t felfel d.t com
----
I don't see many people getting much use out of this feature; so I'll put an example up.
I use this for modifying data in rows retrieved from a database, customizing outputs, etc.
<?
function test_1($var) {
if($var%3)
return $var;
else
return 0;
}
function test_2($var) {
if($var<25)
return 25+($var%5);
else
return $var*2;
}
function test_3($var) {
if($var>30)
return $var+16;
else
return $var-16;
}
function test_4($var) {
if($var&459)
return $var|255;
else
return $var&255;
}
mt_srand(time());
$n=mt_rand(0,9000);
for($i=1;$i<5;$i++) {
$func="test_$i";
echo $func($n)."\n";
}
?>