The subject matter here is kind of arbitrary, but suppose I'd like to be able to run through such a file, find today's date, and drop the data afterward into variables ($artist, $painting) so I could continue to work with them -- what would be the best way to accomplish that?jul 4
Picasso
Three Musicians
---
jul 5
Vincent Van Gogh
Bedroom at Arles
---
jul 6
Rembrandt
The Return of the Prodigal Son
...
etc.
I thought maybe some kind of array like:
Code: Select all
$daily_art = array(
"jul 4" => array("artist" => "Picasso", "painting" => "Three Musicians"),
"jul 5" => array("artist" => "Van Gogh", "painting" => "Bedroom at Arles"),
"jul 6" => array("artist" => "Rembrandt", "painting" => "The Return of the Prodigal Son"),
...)I'm wondering (1) is this the best way to go about this? (2) If so, how in the world can I generate that kind of array from my text file? and (3) If I can use array_search to find the date key (which doesn't really seem to be working for me right now...), is it pretty easy to extract 'artist' and 'painting' from there?
Thanks!