How to remove $ from associate array using Json_decode in php?
- by Chase
I am trying to use the youtube API to pulldown some videos for my site. Currently am running this code here:
//Youtube Videos Pull Down
$youtubeURL = "http://gdata.youtube.com/feeds/api/videos?alt=json&q=cats+cradle+chapel+hill&orderby=published&max-results=10&v=2";
$youtubeSearch = file_get_contents($youtubeURL, true);
$youtubeArray = json_decode($youtubeSearch, true);
Not having any problems accessing certain elements of the associative array however youtube's api is putting $ in many of its array elements .. such as [media$group]
Anytime I try to access an array with one of the $ elements in it, it doesn't work. Suggestions?
I have tried preg_replace but can't seem to get my expression right.