Ask Question

Assume that a variable named $currentRecord has already been used to read a line of text from a file and contains the string "Chris:Smith:2005". Which of the following lines of code will correctly parse the string and store the three values into variables $firstName, $lastName, and $year?

+1
Answers (1)
  1. 30 October, 10:54
    0
    list ($firstName, $lastName, $year) = explode (":", $currentRecord);
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Assume that a variable named $currentRecord has already been used to read a line of text from a file and contains the string ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers