Triangle style output, incrementing max line length
The output of your program is not as you are saying. This is the real output:

1
23
456
78910
1112131415
161718192021
22232425262728


To get your desired output, you can change this:
echo $i;

To:
echo $i.&quot; &quot;;

This will append the extra space after each iteration.

$a
a is a poor variable name. You could make your code much clearer if you gave it a meaningful name, like $countOfNumbersToDisplay. Sure, it's a lot longer to type, but it indicates your intention much more clearly than $a.
Same goes for $b.

Avoid magic numbers
This is not very easy to understand:
      if ($i == $a){
        echo &quot;&lt;/li&gt;&lt;li&gt;&quot;;

        $a = $i + 2 + $b;
        $b++;
      }

Why + 2? This really could use some clarification. I suggest to make 2 a constant with a meaningful name earlier in your code.