I have the following string which I've managed to get cleaned up into a clear format:
string(191) "twitter:3 facebookshare_count:5 like_count:0 comment_count:0 total_count:8 click_count:5 buffer:0 pinterest:0 linkedin:0 stumbleupon:0 redditscore:0 ups:8 downs:3 google:4 delicious:0 digg:0 "
I am now trying to take this and create an array so each digit is associated with its platform.
$shares = array(
'twitter' => 3,
'facebookshare_count' => 5,
'like_count' => 0
)
and so on...
I've been looking at the explode function, using spaces as the delimiter, but I'm really stuck on how to achieve this end result.
I am relatively new to PHP, and struggling to find the words to use to search for this problem. I don't know if 'array' or 'object' is even the right terminology here.