have a variable read from a db which contains a # formatted XXXXXXXXXX and i want to convert it to XXX-XXX-XXXX for display purposes on a site. anyone know how to do it?
i thought about using LEFT to crop it into 3 variables and then CONCAT them together, but seems like it is more complex way.
$num = 1234567890; $formatted = substr($num,0,3)."-".substr($num,3,3)."-".substr($num,6,4);
thank you!