How to use the array to display the caption in the title?

There samopisny the php engine, which works with the api, the actual problem lies in the fact that you need keywords in the page to add an array which is the category under the form of keys.

Now works perfectly an array of the title
 $_GET["id"] = abs((int)$_GET["id"]);
 $answer = $GLOBALS["obj"] -> parse_xml($GLOBALS["obj"] -> goods_info($_GET["id"],$GLOBALS["currency"]));
 if($answer -> retval != 0){
 $head["title"] = "product Description";
 $head["title"] = $answer -> product -> name;

there is a function of the output category on the product page or in the category
$cat = $answer -> product -> categories -> category;

how to pass it in the keywords keys

$head ['keywords'] = $answer -> categories -> category;
does not work tried everything can I somewhere missed something tell me?

in the template itself
<title><?php echo $head["title"];?></title>
<meta name="description" content="<?php echo $head[" description"];?>" />
<meta name="keywords" content="<?php echo $head ['keywords'];?>" />
June 10th 19 at 15:15
1 answer
June 10th 19 at 15:17
What displays do you have
$cat = $answer -> product -> categories -> category;

Also, just in
print_r( $answer ->product ->)>
It was still not bad

After this you can draw conclusions about what is not working

Find more questions by tags PHP