This commit is contained in:
2024-11-18 19:59:19 +01:00
parent 1d81d840cf
commit d5a6f7878c
27 changed files with 120 additions and 1030 deletions

View File

@@ -11,7 +11,7 @@
*/
function generateScriptData(array $phpArray):string {
// Check if the array is associative and single-level
if (is_array($phpArray) && count($phpArray) > 0 && count(array_filter(array_keys($phpArray), 'is_string')) === count($phpArray)) {
if (count($phpArray) > 0 && count(array_filter(array_keys($phpArray), 'is_string')) === count($phpArray)) {
// Generate JavaScript code to save each array element to local storage
$out = "<script>";
foreach ($phpArray as $key => $value) {