ID: 45138 User updated by: bahadir at eggdrop dot gen dot tr Reported By: bahadir at eggdrop dot gen dot tr Status: Bogus Bug Type: Filesystem function related Operating System: Windows XP PHP Version: 5.2.6 New Comment:
var_dump($inthere); Result: array(4) { [0]=> string(8) "bahadir " [1]=> string(6) "baris " [2]=> string(6) "alper " [3]=> string(5) "halil" } Previous Comments: ------------------------------------------------------------------------ [2008-05-30 13:55:54] [EMAIL PROTECTED] See the output: var_dump($inthere); The ignore the newlines use the second parameter (flags) with FILE_IGNORE_NEW_LINES. ------------------------------------------------------------------------ [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