Brotzka\DotenvEditor\DotenvEditor::save PHP Method

save() protected method

Saves the given data to the .env-file
protected save ( $array ) : boolean
$array
return boolean
    protected function save($array)
    {
        if (is_array($array)) {
            $newArray = array();
            $c = 0;
            foreach ($array as $key => $value) {
                $newArray[$c] = $key . "=" . $value;
                $c++;
            }
            $newArray = implode("\n", $newArray);
            file_put_contents($this->env, $newArray);
            return true;
        }
        return false;
    }