Skip to content
Related Articles

Related Articles

Improve Article

PHP | iconv_get_encoding() Function

  • Last Updated : 27 Aug, 2019

The iconv_get_encoding() function is an inbuilt function in PHP which is used to retrieve the internal configuration variables of iconv extension.


mixed iconv_get_encoding( $type = "all" )

Parameters: This function accepts single parameter $type. The value of $type parameter are:

  • all
  • input_encoding
  • output_encoding
  • internal_encoding

Return Value: This function returns the current value of the internal configuration variable on success or FALSE on failure.

Below program illustrates the iconv_get_encoding() function in PHP:


// Use iconv_set_encoding() function
// with encoding parameter
iconv_set_encoding("input_encoding", "UTF-8");
iconv_set_encoding("internal_encoding", "UTF-8");
iconv_set_encoding("output_encoding", "ISO-8859-1"); 
array(3) {
  string(5) "UTF-8"
  string(10) "ISO-8859-1"
  string(5) "UTF-8"


My Personal Notes arrow_drop_up
Recommended Articles
Page :