duanemei2194 2013-06-21 12:32
浏览 30
已采纳

如何在PHP中将int附加到字符串?

I have a clickatell integration in my shop. I need to insert my country code (45) in front of the phone number that gets send to the API.

I have this code that pulls the phone number from the order. How do i enter 45 in front of phone without spaces ?

$to      = $orderData->phone;

I am thinking something like this :

$to      = 45 . $orderData->phone;

But i do not know enough about php to get it working.

  • 写回答

2条回答 默认 最新

  • duanmibei1929 2013-06-21 12:34
    关注
    $to = '45' . $orderData->phone;
    

    Should do it.

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

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部