php - Unexpected T_FOREACH -


i'm trying echo foreach, , i'm not sure on correct way this. i've tried making variable inside of foreach , echoing that, that'll echo last value of array. please show me correct way this:

$client->sendmsgspecial("glows updated", "your glows have succesfully been updated. following have been updated: " .  foreach($glows $value) { echo $value . ', '; }  . "", "glows"); 

try implode instead generating string that.

$glowvar = implode(',', $glows); $client->sendmsgspecial("glows updated", "your glows have succesfully been updated. following have been updated: " . $glowvar . ", "glows"); 

or if want try way -

$str = ''; foreach($glows $value) {     $str .= $value . ', '; } $client->sendmsgspecial("glows updated", "your glows have succesfully been updated. following have been updated: " . $str . ", "glows");