I am currently working on this project, which requires me to make a function that dynamically resolves the directory name and then creates a simple .txt file in this directory.
my code is as follows: ($ destinatario - string)
$diretorio="../messages/".$destinatario;
if (is_dir($diretorio)) {
;
}else{
mkdir($diretorio);
}
$path=$diretorio."/".$data.",".$assunto.",".$remetente.".txt";
$handle=fopen($path,'w+');
fwrite($handle, $corpo);
fclose($handle);
Never think of Portuguese, but the bottom line is that it must create a .txt file using the naming conventions I have given. The funny thing is that when I do this, php creates this strange file whose file name is "09/01/2010 04" (without the extension at all), which is the first few characters of the actual file name that I would like to create ...
edit ($ data is actually the result of calling on a date ("dmY H: i"))