How do I Format a number with leading zeros in PHP

I want to be able to have a variable with a fixed number of digits. If the variable is less than the fixed number of digits I want to add some leading zeros. For example if I have a number 7654321 and I want the fixed number of digits to be eight the resulting variable should be 07654321

Is there a PHP function for that?


Bob from Germantown

How do I stop users from clicking a button multiple times?

I have an old VB.NET web forms application that has a function that takes 30 seconds or so to run when a button is clicked. I need to prevent users from clicking the button multiple times while it is still processing.

Somehow disabling the button to prevent multiple submissions is the ideal for this application. How can I do this?

Harrison from Germantown.

Differences/Advantages of Cache vs Session

I have a Web Development question. What is the main difference between storing information in a Session v.s. a Cache? Advantages and disadvantages?
If I have a simple search page which returns the results to a data table and binds it to a grid view. If I want to store the search results, is it better to store it in a Session since each user would most likely have different results or can I still store the searches in Cache.

Jason from Washington DC