I have a array of page numbers:
foreach($elements as $el) {
$pageno = $el->getAttribute("pageno");
echo $pageno ;
}
Sadly it contains duplicates. I tried the follow code but it won't return a thing:
foreach(array_unique($elements) as $el) {
$pageno = $el->getAttribute("pageno");
echo $pageno ;
}
How to remove the duplicate page numbers? Thanks in advance :)
$elementsis not an array?getAttributesounds like domdocument object maybe?array_unique()?getAttributeinside his loop, so array_unique can't work here imo