how i can display numbers ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • orked
    New Member
    • Jan 2009
    • 49

    how i can display numbers ?

    i want to display number using echo, i wrote the following code
    Code:
    <?php
    $a= 01020;
    echo $a;
    ?>
    Code:
    the result :582
    i don't understand the result.
    this happen only if i add zero to the first place in the number i mean if i write 1020 there is no problem the number will be appeared as it.
    please i need an explanation for that.
    thanks in advance
    shreen
  • improvcornartist
    Recognized Expert Contributor
    • May 2007
    • 303

    #2
    Preceding the number with a zero makes it no longer an integer, but octal notation. This page has a little additional info.

    Comment

    • orked
      New Member
      • Jan 2009
      • 49

      #3
      thank you very much i understand the point now.

      Comment

      Working...