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

Posted by Mladen Gogala on 08/10/06 14:49

On Wed, 09 Aug 2006 20:11:15 -0700, Russ.Dilley 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.
>

Looks fine to me:
$ php -r '$data=array(1,2,3);$n=2; $n *= $s = count($data); print "N=$n\n";'
N=6
$


--
http://www.mgogala.com

 

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

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