answersLogoWhite

0

To shuffle an array in PHP is easy to do, all you need to use is the shuffle() function like shown below:

<?php

$array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);

shuffle($array); // array results will be randomly shuffled

?>

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

How do you center a container in php?

You do not center any HTML constructs inside PHP itself. First of all its bad practice to mix php code with HTML, for that you can use a template engine like smarty. Next, in case you DO want to mix HTML and PHP, then simply give the "container" element an ID or a class name. This one then can be styled via CSS.


What are semantics in PHP?

PHP is related with HTML. HTML can be included into PHP script as well as PHP script can be included into HTML code. PHP begins and ends with &lt;?php ?&gt;. PHP is mix of few languages so semantics is mixed too.


What is the difference between a numericial array and an associative array?

A numericial array is an array with keys made up of only integers. An associative array is an array with keys made up of anything that is not an integer. In some languages, it is possible to mix integer keys and non-integer keys into a mixed array.


How do you mix PHP with a string inside CodeIgniter function?

You must start with double quotes to get expanded variables, then escape nested ones with backslash &lt;?php echo form_radio($data['filename'], 0, '', "class="uniform" id="$data[ids]""); Or use single quotes inside double &lt;?php echo form_radio($data['filename'], 0, '', "class='uniform' id='$data[ids]'"); Notice you don't need to quote single dimensional array indexes inside the square braces if inside double quotes


What is class 30 design mix?

M30 mix should be a mix design in laboratory with the available raw materials that is used in the preparation of concrete. The aggregates, sand have different compressive strength, water absorption and these values are used in mix design.


What is considered an optimal mix of output?

The optimal mix of output is known in economics as the most desirable combination of output attainable with available resources, technology, and social values.


What possible problems could mixing the 2 languages in a C program cause the programmer?

Well, if you mix C-language with PHP (for example), the resulting "program" won't work in any of the two.


What colors do you mix in order to get black?

To get black, you can mix the colors red, yellow, and blue. You can also mix cyan, magenta, and yellow to make black.


What color to be mix in order to get black?

brown and green


What color to be mix in order to have a black color result?

You have to mix the three primary colors: Blue, Yellow, and Red.


Why do conservatives want to mix religion and politics?

Conservatives often believe that moral values and principles rooted in religion should be reflected in governance to promote social order and stability. They view religious beliefs as a guiding force for decision-making and see them as essential for preserving traditional values in society. Mixing religion and politics aligns with their vision of promoting a moral and ethical foundation for governance.


What color do you mix to make the color orange?

You mix red and yellow in order to make the color orange... hope this helps :)