我有一个功能,需要为俄语和英语版本进行 2 个翻译。我已经简单地做到了:'message' => trans('notify.bust_withdraw') . $get->amount . X = . $cashout . trans('notify.bust_nostart') . $profit . ,但我收到错误:Parse error: syntax error, unexpected ''. $get->amount . '' (T_CONSTANT_ENCAPSED_STRING), expecting ']'X = 这是静态词,没有翻译。为什么我收到错误?我的错误可能在哪里?编辑:我的完整代码:Notify::create(['user_id' => $this->user->id,'title' => 'Crash Game','message' => trans('notify.bust_withdraw') . $get->amount . 'X =' . $cashout . trans('notify.bust_nostart') . $profit ,'status' => '1',]);
1 回答
ITMISS
TA贡献1871条经验 获得超8个赞
尝试这个:
$message = trans('notify.bust_withdraw') . $get->amount . 'X =' . $cashout . trans('notify.bust_nostart') . $profit;
Notify::create(
[
'user_id' => $this->user->id,
'title' => 'Crash Game',
'message' => $message ,
'status' => '1'
]);
我为静态字符串“X =”添加了字符串文字,并删除了 . 最后因为没有更多的串联
- 1 回答
- 0 关注
- 69 浏览
添加回答
举报
0/150
提交
取消