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 8318223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:53:09+00:00 2026-06-08T21:53:09+00:00

I have a strange situation with file_get_contents . A webservice returns me an url

  • 0

I have a strange situation with file_get_contents.
A webservice returns me an url, so with that url I use file_get_contents() to get the content of the file from that url.

something like:

$url = $result_from_webservice->url;

if( file_get_contents( $url ) ){
    echo 'ok';
}
else{
    echo 'error';
}

the result of that pice of code whas “error“.

so I have tried to set $url var directly. I have display the url result

echo $result_from_webservice->url;

from witch I have obtained the url like:
https://site.com/page.php?foo1=bar1&foo2=bar2

and then I used the direct result like:

$url = 'https://site.com/page.php?foo1=bar1&foo2=bar2';

and surprise.. that worked (result = “ok”).

then I tried to apply urldecode, thinking that my smart browser has tried to smooth the page content.

$url = $result_from_webservice->url;
    $url = urldecode( $url );

but no success.

I have allowed php to print all errors and no errors, no warnings, no notice.

Do someone has an idea about what happens here and how can I solve it?

  • 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-08T21:53:11+00:00Added an answer on June 8, 2026 at 9:53 pm

    Try to cast the URL to a string before using it:

    $url = (string)$result_from_webservice->url;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a strange situation: I'm using jpa/hibernate to get rows from a mySql
i have a strange situation may its a easy fix or something i may
Here's the situation: I have a bit of graphical content inside a symbol that
I have strange situation - when I'm trying to update model, that can contains
I have a strange situation. I have to use NVL(columna, columnb) in Oracle and
I have a strange situation with PHP working differently from HTML. I'm not a
Trying my hand with jQuery. I have this strange situation that i wish to
I have this strange issue where anytime I open a XAML file that contains
I have a strange situation where I can't see why the IEventDispatcher interface that
I have a strange situation in regards to xml serialization... If I run MyApp.exe

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.