라이브러리

[PHP] mb_list_encodings - 지원되는 모든 인코딩의 배열을 반환합니다.




PHP 에서 `mb_list_encodings` 함수는 문자열 인코딩 목록을 반환하는 함수입니다. 이 함수는 PHP 7.3 버전부터 사용할 수 있습니다.

mb_list_encodings 함수의 사용법


`mb_list_encodings` 함수는 다음과 같은 형식으로 사용할 수 있습니다.

#hostingforum.kr
php

array mb_list_encodings ([ string $encoding_type = "all" ] )



- `encoding_type`: 문자열 인코딩 유형을 지정할 수 있습니다. 기본값은 `"all"`입니다. `"all"`은 모든 인코딩 유형을 반환합니다. `"readable"`은 읽을 수 있는 인코딩 유형을 반환하고 `"writable"`은 쓸 수 있는 인코딩 유형을 반환합니다.

예제


다음 예제는 `mb_list_encodings` 함수를 사용하여 모든 인코딩 유형을 반환하는 방법을 보여줍니다.

#hostingforum.kr
php

$encodings = mb_list_encodings();

print_r($encodings);



이 코드를 실행하면 모든 인코딩 유형이 출력됩니다.

예제: 읽을 수 있는 인코딩 유형


다음 예제는 `mb_list_encodings` 함수를 사용하여 읽을 수 있는 인코딩 유형을 반환하는 방법을 보여줍니다.

#hostingforum.kr
php

$encodings = mb_list_encodings("readable");

print_r($encodings);



이 코드를 실행하면 읽을 수 있는 인코딩 유형이 출력됩니다.

예제: 쓸 수 있는 인코딩 유형


다음 예제는 `mb_list_encodings` 함수를 사용하여 쓸 수 있는 인코딩 유형을 반환하는 방법을 보여줍니다.

#hostingforum.kr
php

$encodings = mb_list_encodings("writable");

print_r($encodings);



이 코드를 실행하면 쓸 수 있는 인코딩 유형이 출력됩니다.

참고


`mb_list_encodings` 함수는 PHP 7.3 버전부터 사용할 수 있습니다. 이전 버전의 PHP에서는 이 함수를 사용할 수 없습니다.
  • profile_image
    나우호스팅 @pcs8404 

    호스팅포럼 화이팅!

    댓글목록

    등록된 댓글이 없습니다.

  • 전체 10,077건 / 421 페이지

검색

게시물 검색