Contenu connexe
Similaire à PHPで使うIPv6の実際 (20)
Plus de Tetsuji Koyama (14)
PHPで使うIPv6の実際
- 29. PEAR::Net_Socketつづき
require_once 'Net/Socket.php';
$sock = new Net_Socket;
$sock->connect('ipv6.google.com', 80);
$out = "GET / HTTP/1.1rn";
$out .= "Host: ipv6.google.comrn";
$out .= "Connection: Closernrn";
$sock->write($out);
while (!$sock->eof()) {
echo $sock->gets(128);
}
$sock->disconnect();