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

  • SEARCH
  • Home
  • 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 8603567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:21:17+00:00 2026-06-12T02:21:17+00:00

I am using yahoo’s finance stock quotes to get the stock ticker data from

  • 0

I am using yahoo’s finance stock quotes to get the stock ticker data from their api .
To grab the data using

$data = file_get_contents("http://quote.yahoo.com/d/quotes.csv?s=appl&f=sl1d1t1c1ohgv&e=.csv"); 
$values = explode(",", $data);
echo '<pre>';
print_r($values);    

Now this works perfectly fine in my local server (localhost) , i.e $values are echoed out .
But when i upload this file onto my server ,it prints out the URL : http://quote.yahoo.com/d/quotes.csv?s=appl&f=sl1d1t1c1ohgv&e=.csv . I know there is some issue with the file_get_contents on the server . Even allow_url_fopen is set to ‘ON’ on the server .Just cant seem to figure out the issue on the server end .

  • 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-06-12T02:21:18+00:00Added an answer on June 12, 2026 at 2:21 am

    You probably are having problems with server settings not letting you use file_get_contents(). In PHP curl will be your friend when trying to pull in content from other domains.

    I just found this awesome little snippet: http://snipplr.com/view/4084

    It’s a function to replicate the functionality of file_get_contents() but uses curl:

    function file_get_contents_curl($url) {
        $ch = curl_init();
    
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
        curl_setopt($ch, CURLOPT_URL, $url);
    
        $data = curl_exec($ch);
        curl_close($ch);
    
        return $data;
    }
    

    Your new code would look like this:

    $data = file_get_contents_curl("http://quote.yahoo.com/d/quotes.csv?s=appl&f=sl1d1t1c1ohgv&e=.csv"); 
    $values = explode(",", $data);
    echo '<pre>';
    print_r($values);    
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have to get stock quotes from yahoo finance api n use it in
I'm using the Yahoo Finance Streaming API to get stock quotes, I wanted to
i an displaying live stock quotes using $data = file_get_contents(http://quote.yahoo.com/d/quotes.csv?s=$symbol&f=sl1d1t1c1ohgv&e=.csv); but i am using
I'm using Yahoo Finance API like this: http://download.finance.yahoo.com/d/quotes.csv?s=GBPEUR=X&f=l1 That gives me the current rates
I am using yahoo finance to get stock quotes. Now i want to get
I'm attempting to get order data from a Yahoo store. I'm using the docs
I'm using YAHOO.util.Connect.asyncRequest to get data from database, here is the code : function
I'm using the following piece of code to pull a stock price from yahoo
Is anyone using the Yahoo! Travel API? I'm trying to look through their documentation,
I have this code that will return keyword suggestion from yahoo using the api.

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.