CVS update: php3/doc/chapters

From: Date: Tue, 08 Dec 1998 03:11:28 +0000
Subject: CVS update: php3/doc/chapters
Groups: php.dev 
Request: Send a blank email to php-dev+get-2711@lists.php.net to get a copy of this message
Date: Monday December 7, 1998 @ 22:11 Author: jim Update of /repository/php3/doc/chapters In directory asf:/u/temp/cvs-serv13868/chapters Modified Files: lang-syntax.sgml Log Message: Add notes from errata. Index: php3/doc/chapters/lang-syntax.sgml diff -c php3/doc/chapters/lang-syntax.sgml:1.24 php3/doc/chapters/lang-syntax.sgml:1.25 *** php3/doc/chapters/lang-syntax.sgml:1.24 Mon Dec 7 17:24:59 1998 --- php3/doc/chapters/lang-syntax.sgml Mon Dec 7 22:11:27 1998 *************** *** 95,100 **** --- 95,104 ---- $names[] = "Jack"; // $names[1] = "Jack" </programlisting> </informalexample> + + <para> + As in C and Perl, array elements are numbered starting with 0, not 1. + </sect2> <sect2 id="variable-init.object"> *************** *** 564,578 **** <title>Array manipulation</title> <para> ! PHP supports both scalar and associative arrays. In fact, there ! is no difference between the two. You can create an array using ! the <function>array</function> function, or you can explicitly ! set each array element value. <informalexample><programlisting> $a[0] = "abc"; $a[1] = "def"; $b["foo"] = 13; </programlisting></informalexample> <para> --- 568,591 ---- <title>Array manipulation</title> <para> ! PHP supports both scalar and associative arrays. In fact, there is no ! difference between the two. You can create an array using the ! <function>list</function> or <function>array</function> functions, or ! you can explicitly set each array element value. <informalexample><programlisting> $a[0] = "abc"; $a[1] = "def"; $b["foo"] = 13; + </programlisting></informalexample> + + <para> + You can also create an array by simply adding values to + the array. + + <informalexample><programlisting> + $a[] = "hello"; // $a[2] == "hello" + $a[] = "world"; // $a[3] == "world" </programlisting></informalexample> <para> -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#2711) next »