on Win10. here's my code. it just has to sort JSON files that got scrambled and so it does a first-field check and then move the relvant file... why won't this move the file!? all paths check out! WTH!?
$filesFolder = dirname(dirname(__FILE__));
// returns C:\neard\www\client
$fileList = glob($filesFolder.'\\_collexion\\*.json');
$fileCounter = 0;
foreach ($fileList as $index => $reportFile) {
$jsonFile = json_decode(file_get_contents($reportFile), true);
$firstKey = array_key_first($jsonFile);
$fileNameOnly = basename($reportFile);
if ($firstValue == '5') {
echo '---REPORT #'.$fileCounter.' FILENAME: '.$reportFile.'<br>';
rename($filesFolder.'\\_collexions\\'.$fileNameOnly,
$filesFolder.'\\_collexions\\_borked\\'.$fileNameOnly);
break;
}
$fileCounter++;
}
totally stumped. this should be a simple thing! what am i missing??
also: i read all the "php path not found error 3" posts on here. nothing current or useful. some so convoluted, i paled...
TIA.