Jump to content

Need help with php4 compatibility


Imad

Recommended Posts

file_put_contents() was introduced in php5, so its compatible. If ure on php4 u can use fopen() and fwrite() as also stated in the manual:

 

This function [file_put_contents] is identical to calling fopen(), fwrite() and fclose() successively to write data to a file.

 

A simple example:

<?php
$handle = fopen('myfile.txt', 'w');
$content = 'This is some text to be written';
fwrite($handle, $content);
fclose($handle);
?>

 

EDIT: Just to note that php4 is discontinued and use of php5 is encouraged.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.