I just want open popup and close it after 20s. If there more variables I need open more popups for loading page and after 20s each window close it. I have something like this but its only opens window and not closing it.
<?php
foreach($data as $value){
$var = substr(str_shuffle(str_repeat("abcdefghijklmnopqrstuvwxyz", 5)), 0, 5);
$message=$value->url;
echo '<script>(function() {
var '.$var.' = window.open("'.$message.'");
setTimeout(function() {
'.$var.'.close();
}, 20000);
})();</script>';
}
Is there chance open popup individually and close it individually too?