ajax test

This commit is contained in:
2024-02-05 21:21:04 +01:00
parent 5584a61560
commit 2b29d0df16
8 changed files with 147 additions and 14 deletions

9
lib/script_data.php Normal file
View File

@@ -0,0 +1,9 @@
<?php
function generateScriptData($input) :string
{
// Convert PHP array to JSON string
$jsonString = json_encode($input);
// Output JavaScript code with the JSON string
return "<script>let pageData = JSON.parse('$jsonString');</script>";
}