Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $days = array();
- $weekdays = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
- array_push($days,["days"=>"Monday","subject"=>["AI"]]);
- array_push($days,["days" => "Sunday","subject" => ["OOAD","AI"]]);
- array_push($days,["days"=>"Tuesday","subject"=>["OOAD"]]);
- $sortedDays = array();
- for($i = 0 ; $i <= 6 ; $i++){
- for($j = 0 ; $j < count($days) ; $j++){
- if($days[$j]["days"] == $weekdays[$i]){
- array_push($sortedDays,$days[$j]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement