encode Character String for PHP

I want to convert a character string to unicode using urlencode.
This is a sample of Emoji

mb_internal_encoding('UTF-8');
$char = '🌸';

echo urlencode($char);
echo "<br>";
echo rawurlencode($char);

What?
Am I doing right coding??