code: public static function unicodeToHex($char){
  
  		if(!is_string($char) || mb_strlen($char, 'utf-8') !== 1){
  			throw new \InvalidArgumentException('$char must be one single character');
  		}
  
  		$unicode = unpack('N', mb_convert_encoding($char, 'UCS-4BE', 'UTF-8'));
  		return dechex($unicode[1]);
  
  	}
docs: get the unicode hex representation of a unicode character
  
  @param  string $char single character encoded as UTF-8
  @return string       unicode hex representation of the character