I am studying about printf,sprintf and i didnt understand few points, if can some one please help me understand thos points,
At This Link at PHP Manual:
There are explanations are numbered from one to six:
What i didnt understand is: The First and The Second(1(sign specifier), 2(padding specifier)), if can some one please help me with example for thos i will be very thankful.
The sign specifier forces a sign, even if it’s positive. So, if you have
You’ll get:
The padding specifier adds left padding so that the output always takes a set number of spaces, which allows you to align a stack of numbers, useful when generating reports with totals, etc.
You’ll get:
If you prefix the padding specifier with a zero, the strings will be zero padded instead of space padded:
Gives: