|
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]
|