|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-10-21 04:04 UTC] chris at xwave dot ch
I've got this code segement:
--- snip ---
$buffer = fgets($if);
$e = split("\t", trim($buffer));
for ($ic = 0 ; $ic > count($e); $ic++) {
$e[$ic] = trim($e[$ic]);
}
--- snap ---
The string in the array $e[] is never trimmed. In it does just the same as $e[$ic] = $e[$ic];
Same behaviour in chop!
When I changed the code to this:
--- snip ---
$buffer = fgets($if);
$b = trim($buffer);
$e = split("\t", $b);
for ($ic = 0 ; $ic < count($e); $ic++) {
$t[$ic] = trim($e[$ic]);
}
--- snap ---
it works as expected.
Chris
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 06 10:00:01 2025 UTC |
for ($ic = 0 ; $ic > count($e); $ic++) { ^^^ That should be < of course.