CVS update: php3/doc/functions

From: Date: Fri, 13 Nov 1998 14:11:26 +0000
Subject: CVS update: php3/doc/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-2381@lists.php.net to get a copy of this message
Date: Friday November 13, 1998 @ 9:11 Author: ssb Update of /repository/php3/doc/functions In directory asf:/u2/tmp/cvs-serv1256 Modified Files: strings.sgml Log Message: added some examples of PHP's substr() specialities Index: php3/doc/functions/strings.sgml diff -c php3/doc/functions/strings.sgml:1.41 php3/doc/functions/strings.sgml:1.42 *** php3/doc/functions/strings.sgml:1.41 Fri Nov 13 09:07:27 1998 --- php3/doc/functions/strings.sgml Fri Nov 13 09:11:26 1998 *************** *** 1325,1336 **** <para> If <parameter>start</parameter> is positive, the returned string will start at the <parameter>start</parameter>'th character of ! <parameter>string</parameter>. <para> If <parameter>start</parameter> is negative, the returned string will start at the <parameter>start</parameter>'th character ! from the end of <parameter>string</parameter>. <para> If <parameter>length</parameter> is given and is positive, --- 1325,1347 ---- <para> If <parameter>start</parameter> is positive, the returned string will start at the <parameter>start</parameter>'th character of ! <parameter>string</parameter>. Examples: ! <informalexample><programlisting role=php> ! $rest = substr("abcdef", 1); // returns "bcdef" ! $rest = substr("abcdef", 1, 3); // returns "bcd" ! </programlisting> ! </informalexample> <para> If <parameter>start</parameter> is negative, the returned string will start at the <parameter>start</parameter>'th character ! from the end of <parameter>string</parameter>. Examples: ! <informalexample><programlisting role=php> ! $rest = substr("abcdef", -1); // returns "f" ! $rest = substr("abcdef", -2); // returns "ef" ! $rest = substr("abcdef", -3, 1); // returns "d" ! </programlisting> ! </informalexample> <para> If <parameter>length</parameter> is given and is positive, *************** *** 1345,1350 **** --- 1356,1366 ---- characters from the end of <parameter>string</parameter>. If this would result in a string with negative length, then the returned string will contain the single character at <parameter>start</parameter>. + Examples: + <informalexample><programlisting role=php> + $rest = substr("abcdef", -1, -1); // returns "bcde" + </programlisting> + </informalexample> <para> See also <function>strrchr</function> and -- 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 (#2381) next »