i am using array_unique(); to unique array values it perfectly works. but when if getting value form offset it gives error. mission offset.
my array before using array_unique();
$tags_array = explode(',', $tagss);
it gives result :
Array ( [0] => katha [1] => pooja [2] => singer [3] => katha [4] => katha [5] => pooja [6] => archana [7] => dance )
after using array_unique();
$tags_array = array_unique($tags_array);
it gives result :
Array ( [0] => katha [1] => pooja [2] => singer [6] => archana [7] => dance )
i am using it in loop:
for($i=0;$i<count($tags_array);$i++){
echo '<a class="label label-primary tags" href="'.base_url().'home/tag/'.$tags_array[$i].'">'.ucfirst($tags_array[$i]).'</a>';
}
it gives error:
Severity: Notice
Message: Undefined offset: 3
Filename: views/search.php
Line Number: 178
how to make serial wise offset. like
Array ( [0] => katha [1] => pooja [2] => singer [3] => archana [4] => dance )