levivel Posted August 24, 2006 Share Posted August 24, 2006 Hello, My task is to read a list of values from MySQL, compare it to a list from an array, ignore the values that exist both in the MySQL list and the array list, and select a random value from the remaining array. I've found functinos like array_slice, array_rand, multisort_array, but I can't seem to be able to put together the whole picture. Could anyone point me in the right direction?Thanks very much, Levi Quote Link to comment Share on other sites More sharing options...
Barand Posted August 24, 2006 Share Posted August 24, 2006 http://www.php.net/in_array checks if a value is in an arrayhttp://www.php.net/unset will remove array elementshttp://www.php.net/array_rand will return a key at random from the remaining array Quote Link to comment Share on other sites More sharing options...
levivel Posted August 24, 2006 Author Share Posted August 24, 2006 wow thank you - I'll get right on this Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.