How can specific array entries be deleted in PHP?

To delete specific array entries in PHP, you can use the unset() function. This function allows you to unset a specific element in an array, effectively deleting it. You need to provide the index of the element you want to delete as an argument to the unset() function.

// Sample array
$array = [1, 2, 3, 4, 5];

// Delete the element at index 2 (value 3)
unset($array[2]);

// Output the modified array
print_r($array);