'I need the output with 0.5 difference in for loop [duplicate]

I have this for loop:

for ($x = 0; $x <= 10; $x++) {
   echo "The number is: $x <br>"; 
}

For the above for loop the output will be:

0,1,2,3,4,5,6,7,8,9,10 

But I need the difference by 0.5, like this:

0,0.5,1,1.5,2,2.5,3,3.5 ....... 
php


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source