Question: Consider the following script. Which PHP function best approximates its behaviour?<?php
function my_funct ($file_name, $data)
{
$f = fopen ($file_name, 'w');
fwrite ($f, $data);
fclose ($f);
}
?>
[
A
B
C
D
E
file_get_contents()
B
file_put_contents()
C
There is no equivalent function in PHP
D
file()
E
fputs()
Note: The script in this question best approximates the way file_put_contents() works; however, this function does not exist in PHP 4, having been introduced with PHP 5. Therefore, Answer C is correct.