Jump to content

Array elements into one ordered list


ironman32

Recommended Posts

I have a number of array lists that use the rand runction so that the elements come out at random.

Here is my code

<?php
srand((float) microtime() * 10000000);

$input = array("<a href= \http://www.muscleandstrength.com/exercises/good-mornings.html\ >Good mornings</a>",
"<a href= \http://www.muscleandstrength.com/exercises/seated-good-mornings.html\>Seated good mornings</a>",
"<a href= \http://www.muscleandstrength.com/exercises/deadlifts.html\> Deadlift</a>");
$rand_keys = array_rand($input);
//echo $input[$rand_keys[1]] . "\n";



$input1 = array("<a href= \http://www.muscleandstrength.com/exercises/squat.html\>Squat</a>",
"<a href= \http://www.muscleandstrength.com/exercises/dumbbell-squat.html\>Dumbell squat</a>",
"<a href=  \http://www.muscleandstrength.com/exercises/smith-machine-squat.html\>Smith Machine Squat</a>");
$rand_keys = array_rand($input1, 2);




$input2 = array("<a href= \http://www.muscleandstrength.com/exercises/45-degree-leg-press.html\>45 degree leg press</a>",
"<a href= \http://www.muscleandstrength.com/exercises/one-leg-45-degree-leg-press.html\>One leg 45 degree leg press</a>",
"<a href= \http://www.muscleandstrength.com/exercises/dumbbell-lunge.html\>Dumbell lunge</a>");
$rand_keys = array_rand($input2, 2);



$input3 = array("<a href= \http://www.muscleandstrength.com/exercises/seated-calf-raise.html\>Seated calf raise</a>",
"<a href= \http://www.muscleandstrength.com/exercises/45-degress-calf-press.html\>45 degree toe raise</a>",
"<a href= \http://www.muscleandstrength.com/exercises/seated-dumbbell-calf-raise.html>Seated dumbell calf raise</a>");
$rand_keys = array_rand($input3, 2);

?>

 

What I am trying to do is output an element from each array into an ordered list  e.g.

 

1.Good mornings

2.Squat

3.45 degree leg press

 

Can anyone offer any help on this?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.