|
Posted by Paul Herber on 11/03/07 17:41
On Sat, 03 Nov 2007 17:37:58 -0000, "www.phpbasic.com"
<w2ajax@gmail.com> wrote:
>i have a problem with interger number in PHP
><?php
>class read{
> var $num;
> function read($num){
> $this->num = $num;
> }
> function basic(){
> print "NUM: ".($this->num);
> }
>}
>$read = new read(001002);
>$read->basic(); // Output string: NUM: 514
001002 is an octal number.
and 001002 octal = 514 decimal
so remove any leading zeros first.
--
Regards, Paul Herber, Sandrila Ltd.
http://www.sandrila.co.uk/ http://www.pherber.com/
Navigation:
[Reply to this message]
|