first commit
This commit is contained in:
21
BusinessLogic/RemoveTodoList.php
Normal file
21
BusinessLogic/RemoveTodoList.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Menghapus todo di list
|
||||
*/
|
||||
function removeTodoList(int $number): bool
|
||||
{
|
||||
global $todoList;
|
||||
|
||||
if ($number > sizeof($todoList)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for ($i = $number; $i < sizeof($todoList); $i++) {
|
||||
$todoList[$i] = $todoList[$i + 1];
|
||||
}
|
||||
|
||||
unset($todoList[sizeof($todoList)]);
|
||||
|
||||
return true;
|
||||
}
|
||||
Reference in New Issue
Block a user