Latest

Tuesday, July 11, 2017

file_get_contents() error line 75

Asked by: BENY


I am using file_get_contents on my PHP and it throws some errors:

My code

include('get_html/simple_html_dom.php');
$url = $article->url;
$url = urlencode($url);
$patterns = array();
$patterns[0] = '/%2F/';
$patterns[1] = '/%3A/';
$patterns[2] = '/%3F/';
$patterns[3] = '/%3D/';
$replacements = array();
$replacements[0] = '/';
$replacements[1] = ':';
$replacements[2] = '?';
$replacements[3] = '=';
$url = preg_replace($patterns, $replacements, $url);
$html = file_get_html($url);

Error

(1/1) Error Exception
file_get_contents(): Filename cannot be empty
in simple_html_dom.php (line 75)

here $url is exit

How cat i fix this ?



Source

No comments:

Post a Comment

Adbox