RE: [PHP] Warning: file_get_contents(): Filename cannot be empty
| From: | hadi | Date: | Mon, 09 Mar 2015 07:40:40 +0000 |
| Subject: | RE: [PHP] Warning: file_get_contents(): Filename cannot be empty | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-324598@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Ashley Sheridan [mailto:ash@ashleysheridan.co.uk]
> Sent: Monday, March 09, 2015 10:31 AM
> To: Marcos Almeida Azevedo
> Cc: hadi; PHP General
> Subject: Re: [PHP] Warning: file_get_contents(): Filename cannot be empty
>
> On Mon, 2015-03-09 at 15:25 +0800, Marcos Almeida Azevedo wrote:
> > > Hi every one,
> > >
> > > Im getting error while using file_get_contents(): function.
> > >
> > > (Warning: file_get_contents(): Filename cannot be empty)
> > >
> > > Im using file_get_contents(): function to get urls links from
> > ($convert)
> > > variable.
> > >
> > > Here is my code
> > >
> > > <?php
> > >
> > >
> > > error_reporting(E_ALL);
> > > ini_set("display_errors", 1);
> > >
> > >
> > >
> > >
> > > $url = "http://www.sahafah.net/rss.php";
> > >
> > >
> > > $rss = file_get_contents($url);
> > >
> >
> >
> > I believe file_get_contents should be used on a local file and not
> > remote or over http
>
> You can use file_get_contents() on URLs, but you need to have the
> allow_url_fopen ini setting on, which a lot of shared hosting providers won't
> allow. I don't remember if this is on or off by default.
allow_url_fopen its on in my system, im using php on windows with apache.
What about im getting error from file_get_contents().....