This question already has an answer here:
- Get all permutations of a PHP array? 5 answers
we have 3 school branches:
xschool atlanta
xschool ortigas
xschool bagio
I will generate a simple combinations.
How can I generate the array which is below in php language
arr1[0]=> xschool atlanta
arr1[1]=>xschool ortigas
arr1[2]=>xschool bagio
arr1[3]=>xschool atlanta,xschool ortigas
arr1[4]=>xschool atlanta,xschool bagio
arr1[5]=>xschool ortigas,xschool bagio
arr1[6]=>xschool atlanta,xschool ortigas,xschool bagio
I wasn't able to set up algorithm in my mind...
Why I need this algorithm? Sometimes our parttime teachers can work in 2 branches different day. So when we add the teacher to our system, the combobox should show us the list(array) which is above.
</div>