Given an array and variable as following..
array = ['complete','in_progress','planned'];
value = 'planned';
I want to sort the array always starting with the 'value' variable the output should display.
array = ['planned','in_progress','complete'];
eg.
array = ['complete','in_progress','planned'];
value = 'in_progress';
output would be...
array = ['in_progress','complete','planned'];
I tried different ways but I failed to come with a decent solution. Any clean and short ideas?
"complete"moved to the end? It is neither keeping the original relative position nor is it sorted alphabetically