Reputation: 307
I want to have a string all connect together so I can just echo one defined group. I thought this might work.
$randomnum = rand(500000,600000);
$refnum = (echo 'ST' . $randomnum . '-' . $coupon_id . '-' . $userid . '');
$refnum;
Upvotes: 0
Views: 52
Reputation: 180024
You're almost there. You can't assign echo
to a variable like that.
$randomnum = rand(500000,600000);
$refnum = 'ST' . $randomnum . '-' . $coupon_id . '-' . $userid . '';
echo $refnum;
Upvotes: 4
Reputation: 28187
Just do
$refnum = 'ST' . $randomnum . '-' . $coupon_id . '-' . $userid;
Upvotes: 1