cvs: /phpdoc/functions array.sgml strings.sgml

From: Date: Tue, 02 Nov 1999 14:58:48 +0000
Subject: cvs: /phpdoc/functions array.sgml strings.sgml
Groups: php.dev 
Request: Send a blank email to php-dev+get-12077@lists.php.net to get a copy of this message
andrei Tue Nov 2 09:58:48 1999 EDT Modified files: /phpdoc/functions array.sgml strings.sgml Log: Docs for array_pad(). Index: phpdoc/functions/array.sgml diff -u phpdoc/functions/array.sgml:1.26 phpdoc/functions/array.sgml:1.27 --- phpdoc/functions/array.sgml:1.26 Wed Oct 20 18:41:42 1999 +++ phpdoc/functions/array.sgml Tue Nov 2 09:58:47 1999 @@ -81,7 +81,6 @@ </refsect1> </refentry> - <refentry id="function.array-keys"> <refnamediv> <refname>array_keys</refname> @@ -171,6 +170,52 @@ <para> This function was added in PHP 4.0.</para> </note></para> + </refsect1> + </refentry> + + <refentry id="function.array-pad"> + <refnamediv> + <refname>array_pad</refname> + <refpurpose>Pad array to the specified length with a value</refpurpose> + </refnamediv> + <refsect1> + <title>Description</title> + <funcsynopsis> + <funcdef>array <function>array_pad</function></funcdef> + <paramdef>array <parameter>input</parameter></paramdef> + <paramdef>int <parameter>pad_size</parameter></paramdef> + <paramdef>mixed <parameter>pad_value</parameter></paramdef> + </funcsynopsis> + + <para> + <function>array_pad</function> returns a copy of the + <parameter>input</parameter> padded to size specified by + <parameter>pad_size</parameter> with value + <parameter>pad_value</parameter>. If + <parameter>pad_size</parameter> is positive then the array is + padded on the right, if it's negative then on the left. If the + absolute value of <parameter>pad_size</parameter> is less than or + equal to the length of the <parameter>input</parameter> then no + padding takes place. + </para> + + <para> + <example> + <title><function>array_pad</function> example</title> + <programlisting> +$input = array(12, 10, 9); + +$result = array_pad($input, 5, 0); +// result is array(12, 10, 9, 0, 0) + +$result = array_pad($input, -7, -1); +// result is array(-1, -1, -1, -1, 12, 10, 9) + +$result = array_pad($input, 2, "noop"); +// not padded + </programlisting> + </example> + </para> </refsect1> </refentry> Index: phpdoc/functions/strings.sgml diff -u phpdoc/functions/strings.sgml:1.20 phpdoc/functions/strings.sgml:1.21 --- phpdoc/functions/strings.sgml:1.20 Thu Oct 28 13:26:31 1999 +++ phpdoc/functions/strings.sgml Tue Nov 2 09:58:47 1999 @@ -1510,6 +1510,11 @@ <para> This will output "-=-=-=-=-=-=-=-=-=-=". </para> + + <note> + <para> + This function was added in PHP 4.0.</para> + </note> </refsect1> </refentry>

« previous php.dev (#12077) next »