Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Decode URL-encoded strings
<?php rawurldecode(string $string): string
<?php         if (preg_match('/filename\*=utf-8\'\'(.+)$/i', $header, $matches)) {

            return rawurldecode($matches[1]);

        }



        if (preg_match('/.*?filename="(.+?)"/', $header, $matches)) {