I have used for to get some data from a string, now I need to remove the duplicates from it.
The code I have is this:
for ($i = 0, $l = count($videos); $i < $l; $i++) {
$video = explode('>>',$videos[$i]);
$audio = str_replace(' ','',$video[2]);
$subs = str_replace(' ','',$video[3]);
$lang = $audio.'_'.$subs.', ';
}
Which returns this:
es_en, en_es, es_en, es_en, en_es, en_en,
Is there a way to remove the duplicates of it using PHP?