dongman2721 2018-06-13 13:17
浏览 42
已采纳

在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>
  • 写回答

2条回答 默认 最新

  • douxing9813 2018-06-13 13:20
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥15 (关键词-阻抗匹配,HFSS,RFID标签天线)
  • ¥15 机器人轨迹规划相关问题
  • ¥15 word样式右侧翻页键消失