I get some rows from mysql table
And want to put data from column story
to a new-creating .txt
file inside file-system
And gettint error - some folders in path - dont exists
Is there a way to create all missing folders automatically and finally create .txt
file ?
foreach($rows as $row){
$path = $row['pt'] . "/" . $row['title'] . ".txt";
if(!is_file($path)){
fopen($path, "w");
file_put_contents($path, $row['story']);
}
}