You are here: Re: PHP Operators « PHP Programming Language « IT news, forums, messages
Re: PHP Operators

Posted by Armando Padilla on 08/10/06 06:24

yongjin.jiang@gmail.com wrote:
> it is really a confusing expression. i think $n will be set to
> count($data[$]).
>
> Russ.Dilley@gmail.com wrote:
>
>>I have an embarrassingly easy PHP question. I have the following line
>>of code:
>>
>>$n *= $s = count($data[$i]);
>>
>>Where $data is an array and $n and $s are scalars.
>>
>>I'm familiar with the '*=' operator:
>>
>>$n = $n * $s
>>
>>But I'm not sure what the second '=' is doing.
>>
>>Thanks,
>>R.D.
>
>

No actually $n will be set to the product of $s*$n where $s is just the
total number of values in the array data[$i]. so if data[$i] contains
array(1, 2, 3, 5) the count will be 4. There for $s will now be 4 and
then $n*= $s is resolved.

Armando Padilla

 

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

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