php sprintf
-
Hi all, When writing an email in response to a button, I compose the content of the mail from php, using (amongst others) the sprinf instruction in order to create columns with fixed widths: $msg .= sprintf ("%-10s", $item['number']); $msg .= sprintf ("%-30s", $item['product']); $msg .= sprintf ("%-5s", $item['size']); $msg .= sprintf ("%-12s", $item['color']); $msg .= sprintf ("%9d" , $item['quantity]); $msg .= sprintf ("%11.2f", $total); $msg .= "\n"; etc. However, these widths are not always the same in the different rows, resulting in extremely messy emails! I have tried replacing the spaces with periods (sprintf ("%'.-10s",.....) which still gives different column width over de rows. Does anyone have a solution for this problem please? Thanks in advance, William