PHP Get random element out of array 1, show, and move to array 2 -


i'm trying make page when press button randomly returns element out of array1, saves (so can show on page), , moves array2 element doesn't returned second time, have no idea start.

here's source array:

$subject = array (      array("title1","comment1"),      array("title2","comment2"),      array("title3","comment3"),      array("title4","comment4"),  ); 

try these codes:

<?php shuffle( $array1 ); array_push( $array2 , array_pop($array1) ); ?> 

Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -