Question

Write a php script that assigns the days of the week to an array named $days[]....

Write a php script that assigns the days of the week to an array named $days[]. Use output statements to display "The days of the week in English are: " along with the values in the $days[ ] array. Following the output  statements, reassign the values in the $days[ ] array with the day of the week in French. Sunday is Dimanche, Monday is Lundi, Tuesday is Mardi. Wednesday is Mercredi. Thursday is Jeudi. Friday is Vendredi, and Saturday is Samedi. Then use output statements to display "The days of the week in French are: " along with the French values in the $days[ ] array. Save the document as DaysArray.php

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

File: DaysArray.php

<?php
//initializing days array with English Days
$days = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
echo "The days of the week in English are: $days[0], $days[1], $days[2], $days[3], $days[4], $days[5], $days[6]";
//Re-initializing days array with French Days
$days[0]="Dimanche";
$days[1]="Lundi";
$days[2]="Mardi";
$days[3]="Mercredi";
$days[4]="Jeudi";
$days[5]="Vendredi";
$days[6]="Samedi";
echo"<br><br>";
echo "The days of the week in French are: $days[0], $days[1], $days[2], $days[3], $days[4], $days[5], $days[6]";
?>

Screen :

Add a comment
Know the answer?
Add Answer to:
Write a php script that assigns the days of the week to an array named $days[]....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT