How to map numbers utilizing array function

I’d guess that $data is being treated as an integer, and therefore your stristr is returning false.

Try explicitly casting $data as a string:

if ( stristr( strval( $data ), $partial_match ) ) {
            return $mapped_value;
        }

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)