i used kirki drag and drop wordpress plugin for my site to create a sortable list when dragable is enabled.
i was able to create a setting that outputs this array, when i did var_dump for the settings here was what i got
array(3) { [0]=> string(10) "Big Grid 1" [1]=> string(10) "Big Grid 2" [2]=> string(10) "Big Grid 3" }
when in var_dump it sorts correctly when i drag and drop any element, they take there place as sorted in the var_dump array, to me the array given is completely useless till i set values for them .
so the question is how do i output them in php to get sorted just as they where in the array.
i tried switch case but its not working.
here is my code
foreach ($array[0] as $key => $value) {
switch ($key) {
case 'Big grid 1' :
// do something
break ;
case 'Big grid 2' :
// do something
break ;
case 'Big grid 3' :
// do something
break ;
}
}
please i need help on this one.
hope my question was clear.
i am no PHP expert, thus a complex answer would be well appreciated.