Syntax error unexpected T_CONSTANT_ENCAPSED_STRING [closed]

╄→гoц情女王★ 提交于 2019-12-18 09:46:16

问题


I am getting the following error syntax error, unexpected T_CONSTANT_ENCAPSED_STRING on this line $this->email->subject($this->core_model->companyDetails()->coreCompanyName 'User Registration Confirmation'); have I make a mistake with the '' and ""? I have also past the name as $data can I include this in the subject instead of the model call?


回答1:


You probably forgot a comma: Try this:

$this->email->subject($this->core_model->companyDetails()->coreCompanyName, 'User Registration Confirmation');

instead of

$this->email->subject($this->core_model->companyDetails()->coreCompanyName 'User Registration Confirmation');



回答2:


You're missing a dot.

$this->email->subject($this->core_model->companyDetails()->coreCompanyName.'User Registration Confirmation');



回答3:


Did you miss to concatenate the two strings (coreCompanyName and "User Registration Confirmation)? Write a "." between the two. See also here.

The code should look like:

$this->email->subject($this->core_model->companyDetails()->coreCompanyName . ' User Registration Confirmation');


来源:https://stackoverflow.com/questions/9352932/syntax-error-unexpected-t-constant-encapsed-string

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!