oop problem - url
Posted 02 October 2006 - 06:28 PM
Posted 02 October 2006 - 07:00 PM
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community
Posted 02 October 2006 - 07:09 PM
public $number; (that contains the number 01).
While calling a function that adds to that var the number 01, i mean:
$myclass->number + 01; this should output 02, once my variable number is set to be 01.
Wrongly the result comes to be 01+01, where i wanted to be 02.
Thanks for the help.
Posted 02 October 2006 - 07:19 PM
Posted 02 October 2006 - 07:21 PM
like was mentioned before, can you show us the code?
Posted 02 October 2006 - 07:23 PM
<?php $var = 10; echo "Calc: $var+01"; ?>
The echo goes for "Calc: 10+01" instead of 11.
Why? Thank you.
Posted 02 October 2006 - 07:25 PM
It would have to be like this:
<?php $var = 10; echo "Calc: ".($var+01); ?>
or this, which changes the value of $var:
<?php $var = 10; $var += 01; echo "Calc: $var"; ?>
Posted 02 October 2006 - 07:31 PM
<?php // this outputs "01 + 01" $myClass->number = '01'; echo "$myClass->number + 01"; // this outputs "2" echo $myClass->number + 1; ?>
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users