I have four variables... $killhousetries1 = 0 $killhousetries2 = 1 $killhousetries3 = 0 $killhousetries4 = 0 What code could I use to find out the biggest variable out of the 4? (which -this time, would be $killhousetries2) Please help, Thanks... James
I can't quite get my head round a full solution just this second, but just thinking aloud, why not store the variables and their values in an associative array, like array('killhousetries1' => $killhousetries1, 'killhousetries2' => $killhousetries2 etc.) and then sort them in order of size using array_multisort, and then extracting the key names back out to find the top one. That last bit might be unnecessarily complicated - it could be that your data should really be stored in an array in the first place, not as individual variables like you have done. That would save you several steps here. Hope that can start you in the right direction - there might be an even simpler solution, but I am no expert, but then I don't see anyone else helping out...
just add a flag or a note near the variable value.. somthing like: $killhousetries1 = "0 this is v1"; $killhousetries2 = "1 this is v2"; $killhousetries3 = "0 this is v3"; $killhousetries4 = "0 this is v4";