在Codeigniter中添加两个输入值作为字符串[重复]

This question already has an answer here:

I´m trying to add two input values as string not as number, the problem is that they are actually numbers.

'clabe' => $this->input->post('clabe2') + $this->input->post('dc') 

Where clabe2 = 123 and dc = 4;

I want to get result as 1234 not 127

Any help will be appreciated

</div>

Do something like this

Use concatenation operator . for string concatenation

'clabe' => $this->input->post('clabe2') . $this->input->post('dc');

For more : http://php.net/manual/en/language.operators.string.php

Concatenate this and assign to variable like this:

$var = $this->input->post('clabe2') . $this->input->post('dc');
'clabe' => $var