Re: Warning: file_get_contents(): Filename cannot be empty
| From: | Ashley Sheridan | Date: | Mon, 09 Mar 2015 10:03:17 +0000 |
| Subject: | Re: Warning: file_get_contents(): Filename cannot be empty | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-324605@lists.php.net to get a copy of this message | ||
> > > >
> > > > What happens when you debug your code? What does $convert contain?
> > > > Is it a string containing a URL?
> > > Yes it containing string full path of url of the image like this
> > > (http://www.alsahwa-yemen.net/pic_news/1/1_46777.jpg)
> > >
> > >
> >
> > Does it definitely contain only that? Because the error you're getting is saying
> > that it isn't a valid URL string and is in-fact an empty string. Have you checked
> > that every single time you're calling it there is actually a valid URL in that
> > variable?
>
>
> Yes Ash, I have checked that. It have valid url in the variable $convert, you may try the code
> in ur system and see by ur self....
>
I'm not sure how you checked, but I checked and I count 8 instances of
an empty string for $convert when I run your original code.
The cause is that your regular expression is not always producing a
match, so you're imploding on an empty array, creating an empty string.
Thanks,
Ash
http://www.ashleysheridan.co.uk