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
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 ?
Yes i get it from variable that is a db query selecting many rows of single field."lue_lista" is name of db query.
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.
You can use "echo" in the code itself to check the variable value or var_export to check the type.
