I've been working on this for hours; sorry if I'm too impatient to search the whole forum for a solution 🙂
I'm using functions to randomize chapter tidbits for a book.
Here's a partial of one function (normal):
function subplots() {
srand((double)microtime()*1000000);
$subplot = rand(0,10);
if ($subplot == "0") {
echo "<BR>sub: Eric and Cali romance ";
} // subplot
else if ($subplot == "1") {
echo "<BR>sub: Zenite attacks ";
} //subplot
}
OK, what I need to do is count each time a particular subplot is added to the chapters.
Here's what I've tried:
else if ($subplot == "2") {
$sub2=$nsub2;
echo"subplot 2 stated: $sub2";
echo "subplot 2: Travis has writers block. ";
$nsub2++;
} // subplot
Of course I've tried it a thousand different ways; all this does is count $sub2 as '1' each time (I globally declared $nsub2=1😉
I've also tried $nsub2=$nsub2+1;
sigh
I really need some code to make this work.
A 'for loop' just runs on forever (My webhost isn't happy with the run-away scripts I was playing with 😉
Help Please?
Lady Infinity