Přidat otázku mezi oblíbenéZasílat nové odpovědi e-mailemVyřešeno php dotaz

http://cz2.php.net/fsockopen ?

fsockopen() returns a file pointer which may be used together with the other file functions (such as fgets(), fgetss(), fwrite(), fclose(), and feof()). If the call fails, it will return FALSE

Takže (snad víš co je ternární operátor):
$hostname = "poradna.net"; //Bez http://
$ports = array(80, 3306, 21, 5432);

foreach($ports as $port)
{
print $hostname;
print (fsockopen($hostname, $port, $errnum, $errstr, 2)) ? " má " : " nemá ";
print " aktivní port $port";
print "<br><br>";
}

PS: Gooooogle :>: Řešení

Reakce na odpověď

1 Zadajte svou přezdívku:
2 Napište svou odpověď:
3 Pokud chcete dostat ban, zadejte libovolný text:

Zpět do poradny