Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 819171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:15:59+00:00 2026-05-15T02:15:59+00:00

I am trying to use the youtube API to pulldown some videos for my

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:15:59+00:00Added an answer on May 15, 2026 at 2:15 am

    You should be able to access it just fine, you just need to make sure to use single quotes or else php will try to interpolate $group as a variable, so:
    $youtubeArray['media$group']

    And if you want to use it in preg_replace, you have to escape it with a backslash: \$. $ is a valid regex identifier, so the regex is getting tripped up on it.

    If you do replace it though, you should use str_replace. There is no need to bring (slower) regular expressions into this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use YouTube API to upload videos from browser. I read Google
I'm currently trying to use the YouTube API as part of a jQuery plugin
we are trying to use the Google YouTube API to upload videos from our
I'm trying to use the YouTube API to control several you-tube videos. And I'm
Is there a definitive gem for the YouTube API? I'm trying to use youtube_g,
I'm trying to use youtube's api to bring back a listing of a user's
I'm trying to use the Youtube .Net API in F# and I've come across
I'm trying to use svnmerge.py to merge some files. Under the hood it uses
I'm trying to use jQuery to format code blocks, specifically to add a <pre>
I'm trying to use the Optiflag package in my Ruby code and whenever I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.