PHP mod_korean extension Reference
  • Introduction
  • Installation
  • APIs
    • Check Functions
      • check_filename_lib
      • check_htmltbale_lib
      • check_uristr_lib
      • get_microtime_lib
      • human_fsize_lib
      • is_email_lib
      • is_hangul_lib
      • is_iis_lib
      • is_url_lib
      • is_windows_lib
      • buildno_lib
      • version_lib
    • Filesystem Functions
      • filelist_lib
      • getfile_lib
      • getfiletype_lib
      • putfile_lib
      • readfile_lib
      • pcregrep_lib
    • HTML Functions
      • agentinfo_lib
      • autolink_lib
      • get_hostname_lib
      • movepage_lib
      • perror_lib
      • pnotice_lib
    • Charset Functions
      • ncrencode_lib
      • ncrdecode_lib
      • uniencode_lib
      • unidecode_lib
      • utf8encode_lib
      • utf8decode_lib
      • substr_lib
      • postposition_lib
    • Image Functions
      • imgresize_lib
    • Mail Functions
      • mailsource_lib
      • sockmail_lib
Powered by GitBook
On this page
  • Proto type
  • Description
  • Arguments
  • Example
  • See also

Was this helpful?

  1. APIs
  2. HTML Functions

get_hostname_lib

Proto type

string get_hostname_lib (int reverse [, string addr ])

Description

reverse 는 ip address 의 hostname 을 찾을것인지 여부를 결정한다. 값은 0 과 1 로 지정을 한다. 0 은 hostname 을 찾지않으며, 1 은 hostname 을 검색을 하게 된다. IP_ADDR 은 REVERSE 의 값이 1 일때만 지정을 한다. 0 일 경우에는 지정할 필요가 없다.

IP_ADDR 을 지정할 경우는 이 함수의 외부에서 이미 ip address 를 구해 놓았고 이 ip address 의 hostname 을 검색하고 싶을 경우에 사용을 한다.(예제1)

IP_ADDR 을 지정 하지 않을 경우에는 이 함수 자체에서 IP address 를 구해야 할 경우에 사용을 한 다.(예제2, 3)

Arguments

Example

다음의 결과는

111.111.111.111 의 hostname 은 domain.com 입니다.

또는

111.111.111.111 의 hostname 은 111.111.111.111 입니다.

의 결과를 보이게 된다. 이는 hostname lookup 성공과 실패여부에 따라 출력되는 결과가 다르기 때문이다.

get_hostname_lib(0,$a) 는 아무 의미가 없다. 이미 ip address 가 구해져 있는데 REVERSE 를 0 으로 지정하면 ip address 값을 구하겠다는 것이 되므로 하나마나한 결과를 나오게 된다.

<?php
$a = "111.111.111.111";
$b = get_hostname_lib(1,$a);

echo "$a 의 hostname 은 $b 입니다.";
?>

다음의 결과 값은 111.111.111.111 을 가지게 된다.

<?php
$a = get_hostname_lib(0);
echo $a;
?>

다음의 결과 값은 111.111.111.111 또는 domain.com 을 가지게 된다.

<?php
$a = get_hostname_lib(1);
echo $a;
?>

See also

None

Previousautolink_libNextmovepage_lib

Last updated 5 years ago

Was this helpful?