"함수 gethostbyname()"의 두 판 사이의 차이

(새 문서: 분류: 네트워크 ==개요== ;함수 getgostbyname() ==PHP== 분류: PHP {{참고|PHP gethostbyname()}} <syntaxhighlight lang='php' run> $ip = gethostbyname('google.com');...)
 
 
(같은 사용자의 중간 판 3개는 보이지 않습니다)
2번째 줄: 2번째 줄:
==개요==
==개요==
;함수 getgostbyname()
;함수 getgostbyname()
==Go==
[[분류: Go]]
{{참고|Go gethostbyname()}}
<syntaxhighlight lang='go' run>
package main
import (
"fmt"
"net"
)
func main() {
ips, _ := net.LookupHost("example.com")
fmt.Println(ips)
}
</syntaxhighlight>


==PHP==
==PHP==
7번째 줄: 24번째 줄:
{{참고|PHP gethostbyname()}}
{{참고|PHP gethostbyname()}}
<syntaxhighlight lang='php' run>
<syntaxhighlight lang='php' run>
$ip = gethostbyname('google.com');
$ip = gethostbyname('example.com');
echo $ip;
echo $ip;
</syntaxhighlight>
==Python==
[[분류: Python]]
{{참고|Python gethostbyname()}}
<syntaxhighlight lang='python' run>
import socket
ip = socket.gethostbyname('example.com')
print(ip)
</syntaxhighlight>
</syntaxhighlight>

2023년 4월 8일 (토) 11:40 기준 최신판

1 개요[ | ]

함수 getgostbyname()

2 Go[ | ]

package main

import (
	"fmt"
	"net"
)

func main() {
	ips, _ := net.LookupHost("example.com")
	fmt.Println(ips)
}

3 PHP[ | ]

$ip = gethostbyname('example.com');
echo $ip;

4 Python[ | ]

import socket
ip = socket.gethostbyname('example.com')
print(ip)
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}