ID:               28130
 Updated by:       [EMAIL PROTECTED]
 Reported By:      edschouten at il dot fontys dot nl
-Status:           Open
+Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: Gentoo Linux
 PHP Version:      4.3.6
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

file() also returns the line endings, try searching for "2\n" or
"2\r\n" (depending on your file encoding).


Previous Comments:
------------------------------------------------------------------------

[2004-04-23 20:38:51] edschouten at il dot fontys dot nl

Description:
------------
The array_search function works fine when searching through regular
arrays, but when you try to search with it from an array made with
file(), it doesn't find anything.

Reproduce code:
---------------
example.list:
1
2
3
4
5

bug.php:
<?
        $list = file('example.list');
                                                                       
        
        print array_search('2', $list);
?>

Expected result:
----------------
1

Actual result:
--------------
<nothing>


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28130&edit=1

Reply via email to