大家好我想尝试下面的代码,但我得到了parse error: syntax error, unexpected '"'
$product .= "$item_id-""$length-""$Category-".$each_item['quantity'].",";
基本上它意味着展示这样的东西。 1-12 size-blue-13
","
答案 0 :(得分:2)
使用字符串,您可以使用大括号:
$product .= "${item_id}-${length}-${Category}-${each_item['quantity']},";
答案 1 :(得分:0)
PHP variable interpolation vs concatenation
正确的语法 -
$product .= "${item_id}-"."${length}-"."${Category}-".$each_item['quantity'].",";