Friday, December 12, 2025
HomeLanguagesPHP | iconv_get_encoding() Function

PHP | iconv_get_encoding() Function

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

Syntax:

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:

Program:




<?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"); 
  
var_dump(iconv_get_encoding('all'));
  
?>


Output:

array(3) {
  ["input_encoding"]=>
  string(5) "UTF-8"
  ["output_encoding"]=>
  string(10) "ISO-8859-1"
  ["internal_encoding"]=>
  string(5) "UTF-8"
}

Reference: https://www.php.net/manual/en/function.iconv-get-encoding.php

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32445 POSTS0 COMMENTS
Milvus
105 POSTS0 COMMENTS
Nango Kala
6814 POSTS0 COMMENTS
Nicole Veronica
11952 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12029 POSTS0 COMMENTS
Shaida Kate Naidoo
6949 POSTS0 COMMENTS
Ted Musemwa
7199 POSTS0 COMMENTS
Thapelo Manthata
6895 POSTS0 COMMENTS
Umr Jansen
6882 POSTS0 COMMENTS