From f6472a93ce1f7fccb6ad87af3f34de87c7eeda00 Mon Sep 17 00:00:00 2001 From: Philip Olson Date: Tue, 31 May 2005 21:34:35 +0000 Subject: [PATCH] Added an example, moved to new doc style. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@187420 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/strings/functions/trim.xml | 144 +++++++++++++++++++++++---- 1 file changed, 124 insertions(+), 20 deletions(-) diff --git a/reference/strings/functions/trim.xml b/reference/strings/functions/trim.xml index 37daeb4a65..463a1cfecf 100644 --- a/reference/strings/functions/trim.xml +++ b/reference/strings/functions/trim.xml @@ -1,13 +1,14 @@ - + trim Strip whitespace (or other characters) from the beginning and end of a string - - Description + + + &reftitle.description; stringtrim stringstr @@ -58,22 +59,79 @@ + + + + &reftitle.parameters; - You can also specify the characters you want to strip, by means - of the charlist parameter. - Simply list all characters that you want to be stripped. With - .. you can specify a range of characters. + + + str + + + The string that will be trimmed. + + + + + charlist + + + Optionally, the stripped characters can also be specified using + the charlist parameter. + Simply list all characters that you want to be stripped. With + .. you can specify a range of characters. + + + + - - Usage example of <function>trim</function> - + + + + &reftitle.returnvalues; + + The trimmed string. + + + + + &reftitle.changelog; + + + + + + &Version; + &Description; + + + + + 4.1.0 + + The optional charlist parameter was added. + + + + + + + + + + &reftitle.examples; + + + Usage example of <function>trim</function> + ]]> - - - - - The optional charlist parameter was - added in PHP 4.1.0 - - + + + - See also ltrim and rtrim. + + Trimming array values with <function>trim</function> + + +]]> + + &example.outputs; + + + string(5) "apple" + [1]=> + string(7) "banana " + [2]=> + string(11) " cranberry " +} +array(3) { + [0]=> + string(5) "apple" + [1]=> + string(6) "banana" + [2]=> + string(9) "cranberry" +} + +]]> + + + + + + + &reftitle.seealso; + + + ltrim + rtrim +