mercredi 20 octobre 2021

Getting data from Array in order of priority

$data = array(
                    'apple' => 4,
                    'orange' => 7,
                    'banana' => 10
                );
                $muff = array_rand($data );

Is it possible to prioritize some data? For example, apples seem to be more selectable than others.




Aucun commentaire:

Enregistrer un commentaire