This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
openapi: 3.0.0 | |
info: | |
title: HNG11 stage 3 backend task for Team AgbaDevs | |
version: 1.0.0 | |
description: API covering various tasks including authentication, messaging, payments, user management, and more. | |
paths: | |
/auth/register: | |
post: | |
summary: Register a new user |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function shuffleClass($input_array, $num_of_stud){ | |
if (is_array($input_array) && count($input_array)>2 && is_integer($num_of_stud) && abs($num_of_stud) <= count($input_array)): | |
// number is negative | |
if ($num_of_stud < 0): | |
for($i=0; $i<abs($num_of_stud); $i++){ | |
$array1[] = $input_array[$i]; | |
} | |
$array2 = array_diff($input_array, $array1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// initial array entry | |
$initial_array = [4, 8, 2, 5, 2]; | |
// initialise variable to store the final array | |
$final_array = array(); | |
// get the number of elements in the initial array | |
$numberOfElements = count($initial_array); | |
if (!empty($initial_array) && is_array($initial_array) && $numberOfElements > 0){ | |
for($i=0; $i<$numberOfElements; $i++){ |