Re: svn: /phpdoc/ru/trunk/reference/json/functions/ json-encode.xml

From: Date: Mon, 12 Dec 2011 08:39:10 +0000
Subject: Re: svn: /phpdoc/ru/trunk/reference/json/functions/ json-encode.xml
References: 1  Groups: php.doc.ru 
Request: Send a blank email to doc-ru+get-3394@lists.php.net to get a copy of this message
12 декабря 2011 г. 12:59 пользователь Alexander Moskaliov <irker@php.net> написал: > irker                                    Mon, 12 Dec 2011 07:59:40 +0000 > > Revision: > http://svn.php.net/viewvc?view=revision&revision=320878 > > Log: > Updated translation > > Changed paths: >    U   phpdoc/ru/trunk/reference/json/functions/json-encode.xml > > Modified: phpdoc/ru/trunk/reference/json/functions/json-encode.xml > =================================================================== > --- phpdoc/ru/trunk/reference/json/functions/json-encode.xml    2011-12-12 06:33:43 UTC (rev > 320877) > +++ phpdoc/ru/trunk/reference/json/functions/json-encode.xml    2011-12-12 07:59:40 UTC (rev > 320878) > @@ -1,5 +1,5 @@ >  <?xml version="1.0" encoding="utf-8"?> > -<!-- EN-Revision: 320312 Maintainer: irker Status: ready --> > +<!-- EN-Revision: 320527 Maintainer: irker Status: ready --> >  <!-- Reviewed: yes --> >  <!-- $Revision$ --> >  <refentry xml:id="function.json-encode" > xmlns="http://docbook.org/ns/docbook"> > @@ -176,6 +176,76 @@ >  ]]> >     </screen> >    </example> > +   <example> > +    <title>Пример с последовательными индексамим > начинающимися с нуля и непоследовательными индексами > массивов</title> Опечатка: индексамим > +    <programlisting role="php"> > +<![CDATA[ > +<?php > +echo "Последовательный массив".PHP_EOL; > +$sequential = array("foo", "bar", "baz", "blong"); > +var_dump( > + $sequential, > + json_encode($sequential) > +); > + > +echo PHP_EOL."Непоследовательный массив".PHP_EOL; > +$nonsequential = array(1=>"foo", 2=>"bar", 3=>"baz", > 4=>"blong"); > +var_dump( > + $nonsequential, > + json_encode($nonsequential) > +); > + > +echo PHP_EOL."Последовательный массив с одним > удаленным индексом".PHP_EOL; > +unset($sequential[1]); > +var_dump( > + $sequential, > + json_encode($sequential) > +); > +?> > +]]> > +    </programlisting> > +    &example.outputs; > +    <screen> > +<![CDATA[ > +Последовательный массив > +array(4) { > +  [0]=> > +  string(3) "foo" > +  [1]=> > +  string(3) "bar" > +  [2]=> > +  string(3) "baz" > +  [3]=> > +  string(5) "blong" > +} > +string(27) "["foo","bar","baz","blong"]" > + > +Непоследовательный массив > +array(4) { > +  [1]=> > +  string(3) "foo" > +  [2]=> > +  string(3) "bar" > +  [3]=> > +  string(3) "baz" > +  [4]=> > +  string(5) "blong" > +} > +string(43) > "{"1":"foo","2":"bar","3":"baz","4":"blong"}" > + > +Последовательный массив с одним удаленным > индексом > +array(3) { > +  [0]=> > +  string(3) "foo" > +  [2]=> > +  string(3) "baz" > +  [3]=> > +  string(5) "blong" > +} > +string(33) > "{"0":"foo","2":"baz","3":"blong"}" > +]]> > +    </screen> > +   </example> >   </para> >  </refsect1> > > @@ -187,6 +257,13 @@ >     для определения точной ошибки. >    </para> >   </note> > +  <note> > +   <para> > +    При кодировании массива в случае, если его > индексы не являются > +    последовательными числами от нуля, то все > индексы кодируются в строковые > +    ключи для каждой пары индекс-значение. > +   </para> > +  </note> >  </refsect1> > >  <refsect1 role="seealso"> > > > -- > PHP Russian Documentation Mailing List (http://php.net/manual/ru/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Regards, Shein Alexey

« previous php.doc.ru (#3394) next »