file_put_contents

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
            throw new RuntimeException('Unable to write to process ID file.');

        }



        
file_put_contents($this->pathjson_encode(

            
array_merge($this->read(), ['masterProcessId' => $masterProcessId]),

            
JSON_PRETTY_PRINT

        
));

    }
            throw new RuntimeException('Unable to write to process ID file.');

        }



        
file_put_contents($this->pathjson_encode(

            
array_merge($this->read(), ['state' => $newState]),

            
JSON_PRETTY_PRINT

        
));

    }
            throw new RuntimeException('Unable to write to process ID file.');

        }



        
file_put_contents($this->pathjson_encode(

            
array_merge($this->read(), [

                
'masterProcessId' => $masterProcessId,

                
'managerProcessId' => $managerProcessId,

            ]),

            
JSON_PRETTY_PRINT

        
));

    }
            throw new RuntimeException('Unable to write to process ID file.');

        }



        
file_put_contents($this->pathjson_encode(

            
array_merge($this->read(), ['state' => $newState]),

            
JSON_PRETTY_PRINT

        
));

    }