Tags
PHP
Asked 8 years ago
14 Oct 2016
Views 2544
denyy

denyy posted

Fatal error: Call to undefined function file_get_content() in php

i am php learner i got this error
Fatal error: Call to undefined function file_get_content() in
for

if(isset($filenames) && is_array($filenames)){
 $fp=fopen("file/all_in_one.txt","w+");
 foreach($filenames as $value){
	$data=file_get_content($value);
	fwrite($data,$fp);
}
fclose($fp);
}


i am making code for merging all file in one file . i have array of the all filenames in server which is in txt format. so i reading it with file_get_content . so help me with it
Mitul Dabhi

Mitul Dabhi
answered Nov 30 '-1 00:00

you did write good code but done simple mistake . its file_get_contents , there is no function like file_get_content in php . so it should be


	$data=file_get_contents($value);

Post Answer