I'm trying to get the max number available from given digit.
For example :
$inputDigit1 = 4;
$inputDigit2 = 9;
$inputDigit3 = 1;
And the output should be :
$outputDigit1 = 9999;
$outputDigit2 = 999999999;
$outputDigit3 = 9;
For now this is my code :
$output = '';
for ($i=0; $i < $inputDigit; $i++) {
$output.='9';
}
$output = (int) $output;
But I don't know the proper or simpler way to solve this case without use a loop.
You can set number of time the input string should be repeated.