Using PHP I want to format a number(7) like in 6 digits 000007
I had done this via printf Function but wanted to store it in a variable how can I do so.
Below mentioned code not working, giving output as :000007 and printing it on screen:
$gensubjectid=printf("%06d\n", $origionalsubjectid);
Suggest.
sprintf()should do what you need