473,409 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,409 software developers and data experts.

i have a problem with interger number in PHP

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
?>
if i call
$read = new read(1001);
$read->basic();//Output string: NUM: 1001
// is true
who can explain me about problem?
I run this script on local with PHP 5.2.1

Nov 3 '07 #1
1 1278
On Sat, 03 Nov 2007 17:37:58 -0000, "www.phpbasic.com"
<w2****@gmail.comwrote:
>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/
Nov 3 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Avery | last post by:
All my number data in Access 2003 automatically rounds to the nearest interger, even when I request a 2 decimal place format. Is this a known bug and is there a fix for it?
11
by: ian.davies52 | last post by:
Is there anything I can do about the apparent limit on the number of textboxes that have calculations as their control source on a form or report in ms-access? I have a query that pulls together...
2
by: Tim::.. | last post by:
Can someone tell me how I get around the following error? I keep getting the following error on the "RETURN ddlDataSet" line of my code! I don't know how to get arround this and would be grateful...
3
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table)...
11
by: nephish | last post by:
hello there, all. i have a difficult app that connects to a server to get information for our database here. this server is our access point to some equipment in the field that we monitor. ...
2
by: erikcw | last post by:
Hi, I'm parsing xml data with xml.sax and I need to perform some arithmetic on some of the xml attributes. The problem is they are all being "extracted" as unicode strings, so whenever I try to...
2
by: William Manley | last post by:
Is there a way to check if a string can be a interger without crashing the program?
3
by: Pino | last post by:
HI all, I am learning c++ ( just 1 month) and would want an aid for a code. I have a integer vector of length N. ie 3 3 3 4 4 1
40
by: KG | last post by:
Could any one tell me how to reverse the bits in an interger?
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.