let jsVariable = <?= $phpVariable ?>;
fetch('/some/url', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify({some: 'object'})
}).then(res => res.json()).then(json => {
console.log(json);
})
if (isset($idformold) == FALSE) {$idformold = 0;};
$_POST['idform'] != $idformold
выполнится .if (isset(...) == FALSE) {...}; // не надо так
if (!isset(...)) {...} // лучше так
function flattenArray($array, &$resultArray = [], $name = '')
{
foreach($array as $key => $value) {
if (is_array($value)) {
flattenArray($value, $resultArray, $name ? $name."[$key]" : $key);
} else {
$resultArray[$name ? $name."[$key]" : $key] = $value;
}
}
return $resultArray;
}