public function replaceInFile($old, $new, $append = 0)
    {
        $contents = $this->previous;
        $replaceWith = preg_replace("~$old\n?~", "$new\n", $contents);

        file_put_contents($this->getPath(), $replaceWith, $append);

        return $this;
    }
public function replaceInFile($old, $new, $append = 0)
    {
        $contents = $this->previous;
        $replaceWith = preg_replace("~$old\n?~", "$new\n", $contents);

        file_put_contents($this->getPath(), $replaceWith, $append);

        return $this;
    }
public function replaceInFile ( $ old , $ new , $ append = 0 ) { $ contents = $ this -> previous ; $ replaceWith = preg_replace ( "~$old\n?~" , "$new\n" , $ contents ) ; file_put_contents ( $ this -> getPath ( ) , $ replaceWith , $ append ) ; return $ this ; }
Replace a part of the .env file.

@param string $old
@param string $new
@param int    $append

@return \Sven\FlexEnv\Env
Replace a part of the . env file .