I’m doing a for loop to count from 0001 up to 0999
How can i do this with php. All i’ve got so far is a normal php for loop.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Something like this?
Additionally, you can make use of
sprintf()instead ofstr_pad(), but I thinkstr_pad()looks much clearer thansprintf()in this case.