Question and answer is powered by AnsPress.io
I am trying to make a random order id which have prefix called ODD. Now I have only a single number “99”. But I want to make it as “ODD-0000000099”. How can I do this? Please help me.
You can get the result if you try the below code.
$id = 99; echo $order_id = "ODD-".sprintf("%010s", $id);
Result :- ODD-0000000099