Handling Base64 via mbstring is deprecated; use base64_encode/base64_decode instead

Description

Since PHP 8.2, several encodings were dropped from mbstring, including base64.

This is a deprecation, so the feature is available until PHP 9.

Example

<?php

mb_convert_encoding('foo', 'base64');

?>

Solutions

  • It is recommended to use the base64_encode() and base64_decode() functions to do this.