Code: Select all
$x=1;
$total=20;
while($x<=$total){
$elvalue=${'content'.$x.'_25'};
if(!isset($myarray)){$myarray = array();}
$myarray[$x] = array($elvalue);
$x++;
}I'm trying to remove duplicates from ${'content'.$x.'_25'}, I get to construct an array with the code above but with array_unique it seems I can't make it unique properly because each ${'content'.$x.'_25'} is stored inside as nested arrays of $myarray then I can't use array_unique (?)
How could I, possibly from a loop (?) put in the values of ${'content'.$x.'_25'} in an array, not as nested arrays so that I could use array_unique to make the sort and remove all duplicates.
Thanks