#45138 [Opn->Bgs]: What is this?
| From: | felipe@php.net | Date: | Fri, 30 May 2008 13:55:55 +0000 |
| Subject: | #45138 [Opn->Bgs]: What is this? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-125378@lists.php.net to get a copy of this message | ||
ID: 45138
Updated by: felipe@php.net
Reported By: bahadir at eggdrop dot gen dot tr
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: Windows XP
PHP Version: 5.2.6
New Comment:
See the output: var_dump($inthere);
The ignore the newlines use the second parameter (flags) with
FILE_IGNORE_NEW_LINES.
Previous Comments:
------------------------------------------------------------------------
[2008-05-30 13:47:31] bahadir at eggdrop dot gen dot tr
Description:
------------
in_array or file function doesn't work.
Reproduce code:
---------------
My test.php File:
<?php
$findme = 'bahadir';
$inthere = file('names.txt');
if (in_array($findme, $inthere)) {
echo 'yes! :)';
} else {
echo 'no :(';
}
?>
My names.txt File:
bahadir
baris
alper
halil
Expected result:
----------------
Result:
no :(
Why?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45138&edit=1