Oliverkahn Posted April 15, 2014 Share Posted April 15, 2014 can this work??? <?PHP $file_handle = fopen("testFile.html", "w"); $file_contents = "Some test text"; fwrite($file_handle, $file_contents); fclose($file_handle); print "file created and written to"; ?> instead of this... <?PHP $file_handle = fopen("testFile.txt", "w"); $file_contents = "Some test text"; fwrite($file_handle, $file_contents); fclose($file_handle); print "file created and written to"; ?> Link to comment https://forums.phpfreaks.com/topic/287788-pls-can-this-works/ Share on other sites More sharing options...
Ch0cu3r Posted April 15, 2014 Share Posted April 15, 2014 yes Whats the problem? Link to comment https://forums.phpfreaks.com/topic/287788-pls-can-this-works/#findComment-1476241 Share on other sites More sharing options...
dalecosp Posted April 15, 2014 Share Posted April 15, 2014 Yes, you can write to different file types; it may depend on the system what your actual result is. For the most part, in a server environment, the content determines the way it's handled.You might also look into using file_put_contents() instead of the fopen/fwrite/fclose routine, if possible. Link to comment https://forums.phpfreaks.com/topic/287788-pls-can-this-works/#findComment-1476263 Share on other sites More sharing options...
Oliverkahn Posted April 15, 2014 Author Share Posted April 15, 2014 thanks I taught it's only .txt files that can be created Link to comment https://forums.phpfreaks.com/topic/287788-pls-can-this-works/#findComment-1476279 Share on other sites More sharing options...
boompa Posted April 15, 2014 Share Posted April 15, 2014 Why wouldn't you just try it??? SMH Link to comment https://forums.phpfreaks.com/topic/287788-pls-can-this-works/#findComment-1476280 Share on other sites More sharing options...
Oliverkahn Posted April 16, 2014 Author Share Posted April 16, 2014 hmm Link to comment https://forums.phpfreaks.com/topic/287788-pls-can-this-works/#findComment-1476323 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.