Does calling a JSON file in PHP work with CF8?

Fredolino 25 Oct, 2025

Hello,

In CF7, I was able to use a JSON file in the form with PHP.

Example:

$file = file_get_contents("map.json");

$json_decoded = json_decode($file);

How does this work now in CF8? I can display the file directly in the browser, but in CF8 the debugger outputs:

[map_json_encoded] => Array([returned] => NULL))

What is the problem?

F.

Max_admin 26 Oct, 2025
Answer

Hi Fred

Same in v8, you always have to return the PHP variable you need to be set in the Var list:

return $json_decoded;
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.