Best practise way to handle array of pairs
I would work with a two dimensional array, in stead of two separate arrays. You could then shuffle your array to get the items in a random order. Something like this:

$items = [
    ['id' =&gt; 1, 'name' =&gt; 'item 1', 'price' =&gt; '$1.00'],
    ['id' =&gt; 2, 'name' =&gt; 'item 2', 'price' =&gt; '$2.00'],
    ['id' =&gt; 3, 'name' =&gt; 'item 3', 'price' =&gt; '$3.00'],
    ['id' =&gt; 4, 'name' =&gt; 'item 4', 'price' =&gt; '$4.00'],
];

shuffle($items);

foreach($items as $item) {
    echo $item['id'] . ': ' . $item['name'] . ' ' . $item['price'];
    // or whatever you want to do, just trying to demonstrate you
    // won't need those $name and $price variables anymore...
}


I find it makes more sense to keep your item's properties together, in stead of spreading them over different arrays. You know when you pick an element from the items array you will have all it's properties. And to me the code is better readable as well.