如何在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.

$to = '45' . $orderData->phone;

Should do it.

Yes, as noted above, in PHP you can use either '45' . $orderData->phone; or 45 . $orderData->phone; since PHP is not strict about data types.