Kendi dosyalarımdaki kodlardan birini ekliyorum kendinize göre düzenleyebilirsiniz.

$data = '<?php if( !defined("CRXSSYY") ){ exit; }
$ayar16["smtp1"]["sunucu"]	= "'.$sunucu.'";
$ayar16["smtp1"]["port"]	= "'.$port.'";
$ayar16["smtp1"]["mail"]	= "'.$mail.'";
$ayar16["smtp1"]["sifre"]	= "'.$sifre.'";
?>
';

$dosya = fopen("ayar/site/smtp1.php","w"); if( !$dosya ){ echo "Bir hata oluştu."; exit;}
$yaz = fwrite ( $dosya , $data ); if( !$yaz ){ echo "Bir hata oluştu."; exit;}
fclose ($dosya);