# Array Argument for `mb_convert_encoding()`

> Section in “New and Extended Functionality › Internationalisation and Unicode” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/new-and-extended-functionality/internationalisation-and-unicode/array-argument-for-mb_convert_encoding/>

With the `mbstring` extension enabled, you can convert between different encodings:

``` php
var_dump(mb_convert_encoding('seriös', 'ISO-8859-1'));
```

When running this program at a shell that uses UTF-8 encoding, you will see a question mark like substitution character because your shell tries to interpret an ISO-8859-1 string as UTF-8. Nevertheless, the conversion has worked fine.

Since PHP 7.2, you can also pass an array of strings to convert:

``` php
var_dump(mb_convert_encoding(['seriös', 'Maß'], 'ISO-8859-1'));
```

In that case, the result will also be an array.

---

Previous: [New Function mb_scrub()](https://php7explained.com/new-and-extended-functionality/internationalisation-and-unicode/new-function-mb_scrub/index.html.md) | Next: [Regular Expressions](https://php7explained.com/new-and-extended-functionality/regular-expressions/index.html.md)
