Hey make a note of the name attribute in the input element and give it a try.
The below code is for your reference, it is working
<body>
<form action="madLibs.php" method="post">
Apples: <input type="checkbox" name="fruits[]" value = "apples"> <br>
Oranges: <input type="checkbox" name="fruits[]" value = "oranges"> <br>
Pears: <input type="checkbox" name="fruits[]" value = "pears"> <br>
<input type="submit" value="submit">
</form>
<br>
<?php
$fruit = $_POST['fruits'];
echo $fruit[1];
?>
</body>