How can remove duplicate values from an array php

array_unique :Removes duplicate values from an array

Syntax:
array_unique(array,sort flag);
sort flag:
ORT_REGULAR - compare items normally
SORT_NUMERIC - compare items numerically
SORT_STRING - compare items as strings
SORT_LOCALE_STRING - compare items as strings, based on the current locale.

Example:
<?php
$arr = array("php","tutorial","php","example");
 $unique_arr = array_unique($arr); //removes duplicate values from an array
print_r($unique_arr ); 
?> 
Outputs:
Array
(
[0] => php
[1] => tutorial
[2] => example
)