I am creating a custom module and I want to use a couple variables as counters, here is an example:
$variable1 = 0;
$variable2 = 0;
function1(){
$variable1++;
}
function2(){
$variable2++;
}
function3(){
$message = "Nodes".$variable1;
$message .= "Users".$variable2;
drupal_set_message($message);
}
There is a loop in these functions. My problem is that I get an Undefined variable Error. Not sure if there is a Drupal protocol for doing this?