Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The gameSatus.dat file contains give lines of text: the first line contains the

ID: 3793226 • Letter: T

Question

The gameSatus.dat file contains give lines of text: the first line contains the character's name; the second line contains the character's type; the third line contains the number of health tokens; the fourth line contains the number of experience tokens; the fifth line contains the number of supply tokens. Your job is to develop the code in restoreGame.php as follows: open the gameStatus.dat file for reading; red the five lines from the file, close the file. The code to display the information has been provided. GAME CHARACTER GAME CHARACTER

Explanation / Answer

//the below line returns an array.Each line of file represents one element of array. //you don't have to close the file since it returns an array and not a resource $charater = file("gameStatus.dat"); $charName = $charcter[0]; $charType = $character[1]; $healthTokens = $character[2]; $expTokens = $character[3]; $supplyTokesn = $character[4];

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote