Fill the rest with zeroes. PHP

Let’s say a have a variable with value 9 and another one with value 384. If I want the variable to be 5 digits long. How would I automatically fill the rest with zeroes to the left. Just like this:

$var = 9;
$anotherVar = 384;

I want them to have this value:

$var = 00009;
$anotherVar = 00384;

Thanks,
Leo