I am trying to make a card reader for cardcast. I get these cards in a string using file_get_contents and then need to extract the text for each card.
Here is an example piece of the string for one card, each one of these cards is separated by a comma and has the parentheses on either end.
{"id":"030b3406-55ae-4159-9129-04463c61973c","text":["Why does this not work? ",""],"created_at":"2017-06-04T15:13:42+00:00","nsfw":true}
I am trying to extract just the information inside the text tag, in this case ' Why does this not work? ","" ' (minus the single quotes and white space on both ends).
Could someone please help to extract this information using split or regex? I could do this slowly with split but I assume it is more efficient to use regex as there could be multi-hundred cards and this needs to be time efficient.
I looked into preg_match() but did not understand it well enough to get a functioning version.
Thanks