The situation is like this: there is a continuous loop, that updates some values. Then the script checks certain conditions. The (simplified) code:
<?php
set_time_limit(0);
// etc
while(1==1)
{
$a = getFromDatabase('a'); // function to get value of A
$b = getFromDatabase('b'); // function to get value of B
$c = getFromDatabase('c'); // function to get value of C
$d = getFromDatabase('d'); // function to get value of D
if($a >= 12 && time() <= $b && ($d === false || $d <= time()))
{
include 'pages/'.$a.'.php';
}
if($b <= 3 && time() >= $d && ($c === false || $c <= time()))
{
include 'pages/'.$b.'.php';
}
}
My question is: how can I change the order of these IF-statements dynamically?
Like
$order = array('b','a'); // first b then a
Important: the if conditions are really dynamic. So there is no real pattern (the example above is simplified, so not the full conditions)
Put them in functions, then just store the name of the functions and go through each in turn.