While executing this code from a webservice, the title and keywords are shown in the meta tags as expected. The description stays empty though. How do I put dynamic array content from $array in the description? Ps eg $array[3] won't work either.
$array = $result->AAAResult->AAA->A;
$teller = count($array);
$titeltekst = "{$teller} quantity: $r";
$doc =& JFactory::getDocument();
$options = $doc->getHeadData();
$options['title'] = $titeltekst;
$options['metaTags']['standard']['keywords'] = "keywords - test";
$options['metaTags']['standard']['description'] = $array;
$doc->setHeadData($options);
You wont be able to assign an array directly to anything that expects a string, but you can use implode
assuming that all the values are also strings.
$string = implode(', ', $array);
Ok I just added eg.
$string .= $v->Naam;
and;
$options['metaTags']['standard']['description'] = $string;
, if you choose to create the string on the Naam (Name) object of the Array.