So I have a snippet of code that will output a two digit number using saved images…the two digit number could be anything from 1 to 99.
The problem is that anytime it has a trailing zero (10, 20, 30…) - it does not display the “zero” image. I have tried various versions of code using isset, is_null, empty, etc…cannot get this to display properly.
[php]$number = “70”;
$num1 = substr($number,0,1);
$num2 = substr($number,1,2);
echo “Num1 = $num1
Num2 = $num2”; // It is parsing properly…this displays.
$num1 = “”;
if ($num2) {$num2 = “”;} else {$num2 = “”;}[/php]
The IF statement seems to be the problem, but I cannot figure out the solution. Appreciate any help!