|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-09-25 08:01 UTC] plonk at doramail dot com
Description:
------------
Example 2466 on the "trim" explanation page makes no sense, function "trim_value" isn't called anywhere, instead it uses "var_dump" from the example on top of it:
<?php
function trim_value(&$value)
{
$value = trim($value);
}
$fruit = array('apple','banana ', ' cranberry ');
var_dump($fruit);
array_walk($fruit, 'trim_value');
var_dump($fruit);
?>
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Jun 17 02:00:02 2026 UTC |
The example works great. Here is the output. array(3) { [0]=> 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" } Notice the different lengths for banana and cranberry.