file_put_contents
Intervention/image
Supported Versions: PHP 5, PHP 7, PHP 8
Write data to a file
file_put_contents
(
string $filename
,
mixed $data
,
int $flags
=
0
,
?
resource $context
=
null
):
int
|
false
}
$data
=
$this
->
encode
(
$format
,
$quality
);
$saved
= @
file_put_contents
(
$path
,
$data
);
if (
$saved
===
false
) {
throw new
NotWritableException
(
src/Intervention/Image/Image.php