How to remove $ from associate array using Json_decode in php?
Posted
by Chase
on Stack Overflow
See other posts from Stack Overflow
or by Chase
Published on 2010-05-25T19:24:37Z
Indexed on
2010/05/25
19:31 UTC
Read the original article
Hit count: 207
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.
© Stack Overflow or respective owner