What is use of file_put_contents in PHP?

devquora
devquora

Posted On: Dec 11, 2020

 

file_get_contents in PHP is a library function that is used to write text to a file. This function creates a new file if the file doesn't exist.

Syntax

file_put_contents($file, $data, $mode, $context)

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    PHP Interview Questions

    What is T_PAAMAYIM_NEKUDOTAYIM in PHP?

    T_PAAMAYIM_NEKUDOTAYIM is scope resolution operator used as :: (double colon) .Basically, it used to call static methods/variables of a Class...

    PHP Interview Questions

    What is the difference between == and === operator in PHP ?

    In PHP == is equal operator and returns TRUE if $a is equal to $b after type juggling and === is Identical operator and return TRUE if $a is equal to $b, and they are of the same data type...