Search⌘ K

Challenge: Formatter and Hash Generators with Updated Functions

Explore PHP 8's handling of deprecated functions by formatting monetary amounts for four locales using correct currency symbols, implementing a calculator function with operator validation, and generating various hash values including md5 and sha256 through bound functions. You will gain practical skills in working with updated PHP functions and ensure correct coding practices.

This challenge will extensively test your understanding of PHP 8’s deprecated or removed functionalities.

Task 1

  • Create a PHP script that formats a monetary amount in different locales.

  • Set the monetary locale to Japan, Germany, France, and the United Kingdom and format a given amount accordingly.

Instructions

  1. Modify the existing code to include two additional locales: France and the United Kingdom.

  2. For each of the four locales (Japan, Germany, France, and the United Kingdom), format the monetary amount of 4,395,794.89 using the appropriate currency symbol and formatting rules. You can use the provided code as a reference for formatting.

  3. Display the formatted monetary amount for each locale and indicate whether it’s ...