You are here: Re: What is wrong? « All PHP « IT news, forums, messages
Re: What is wrong?

Posted by m6s on 01/07/06 13:42

m6s wrote:
> function getPrice( $sbl ){
> if ( $sbl == $this->$paper[symbol] ){
> return $this->$paper[price];
> }
>
> }
> }
> echo "Building a stock object....\n";
> $sg = new Stocks();
> $sg->setSymbol( "fdas" );
> $sg->setPrice( "100" );
> echo "Stock :".$sg->getPrice( "fdas" );
>
> The getPrice returns nothing...
> I don't understand why... The function resides in a class, as method of
> an object.
Also I did this:
var $paper = array( rec,symbol, price );

function setSymbol( $stk ){$this->$paper[symbol] = $stk;}
function setPrice( $prc ){$this->$paper[price] = $prc;}
So when I pass a symbol, I want to initiate a new array and then fill it
up with data...
I use setSymbol->("bla")
setPrice->("100");
so if the symbol is bla then the price is 100 else return null, nothing...
I think it like that and try to implement it like that...with arrays
holded in this class....

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация