php implode to return string from php module

aleksinverstas332 04 Dec, 2025

I have an array of items that i want to handle as a string.So i created php module where i use implode to concatenate items in variable as string.

$data = $this->get("lue_lista");
$this->set("postilista", implode('; ', $data) );

However chronoengine still refers this variable as array.

Is there a way to return concatenated array as string?

Aleksi

Max_admin 04 Dec, 2025

Hi Aleksi

In your code you are getting and settings a form "var", not a data parameter, your initial variable is under data or vars ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
aleksinverstas332 04 Dec, 2025

Yes i get it from variable that is a db query selecting many rows of single field."lue_lista" is name of db query.

aleksinverstas332 04 Dec, 2025

I have tried few alternatives.If i do this:

$data = $this->get("lue_lista");

$postilista = "";

foreach ($data as $sp) {    $postilista = $postilista . $sp; }

$postilista = implode($postilista, " ");

return $postilista;

I will get php errot that implode gets string. Like it is.

if i do this:

$data = $this->get("lue_lista");

$postilista = "";

foreach ($data as $sp) {    $postilista = $postilista . $sp; }

return $postilista;

then php module returns array instead of string that comes to return.php implode to return string from php module image 1

Max_admin 05 Dec, 2025

You can use "echo" in the code itself to check the variable value or var_export to check the type.

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Post a Reply