I'm getting this warning on my website, im just getting the information is it IP available or not, it's work, its says it's unavailable but it shows an warning also about code, I searched about it, but none of those answers didn't help me. So the code is working, just want to get off this warning. Php 7.x doesn't support syntax like this? The problem is in if (count($test)==1).
$printers = file("printers.txt"); //input txt file with IP addresses in chosen order
$number_of_printers = count ($printers);
for ( $i = 0 ; $i < $number_of_printers ; $i++)
{
$ip=str_replace("
","",$printers[$i]);
$ip=str_replace("","",$ip);
$ip=str_replace("
","",$ip);
$test=@get_headers("http://$ip");
if (count($test)==1){
//do stuff here
echo "<div class='printerwrapper'<div class='location'>$ip is unavailable</div></div>";
continue;
}