Retrieve a list of unique values from an array using array_unique().
Source Code
$input = ["apple", "banana", "apple", "pear", "banana"];
$result = array_unique($input);
print_r($result); // Outputs: Array ( [0] => apple [1] => banana [3] => pear )