strlen($property)) if ($property == substr($lines[$i], 0, strlen($property))){ $lines[$i] = "$property = $value\n"; } } $fp=fopen($filename, 'w'); for($i=0; $i<$n; $i++){ fwrite($fp, $lines[$i]); } fclose($fp); } function UpdateINIFiles() { $api_key = GenerateRandomString(); UpdateIniValue('/etc/airtime/airtime.conf', 'api_key', $api_key); UpdateIniValue('/etc/airtime/airtime.conf', 'baseFilesDir', realpath(__DIR__.'/../../files')); UpdateIniValue('/etc/airtime/pypo.cfg', 'api_key', "'$api_key'"); UpdateIniValue('/etc/airtime/recorder.cfg', 'api_key', "'$api_key'"); UpdateIniValue(__DIR__.'/../../build/build.properties', 'project.home', realpath(__dir__.'/../../')); }