Question: PHP Exercise 1-3 You use the number_format() function when you want to format the appearance of a number. The number_format() function adds commas that separate

PHP Exercise 1-3

You use the number_format() function when you want to format the appearance of a number. The number_format() function adds commas that separate thousands and determines the number of decimal places to display. You can pass two arguments to the number_format() function: The first argument represents the literal number or variable you want to format, and the second argument determines the number of decimal places to display. If you exclude the second argument, the number is formatted without decimal places.

  1. Create a new html document in your text editor.
  2. Be sure to include all the appropriate html tags for a basic document. Add id comments at the top containing: your name, the date, and the words PHP Exercise 1-3
  3. Add the PHP script delimiters to the document body.
  4. Add the following statements to the script section: $SingleFamilyHome = 39950; $SingleFamilyHome_Display = number_format($SingleFamilyHome, 2); echo

    The current median price of a single family home in Pleasanton, CA is $$SingleFamilyHome_Display.

    ;
  5. Save the document as SingleFamilyHome.php in the PHPEx1 folder. In order to test this file, you will need to upload it to your development server. Add it to the ClassEx folder.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!