|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-05-30 13:47 UTC] 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?
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 10:00:02 2025 UTC |
var_dump($inthere); Result: array(4) { [0]=> string(8) "bahadir " [1]=> string(6) "baris " [2]=> string(6) "alper " [3]=> string(5) "halil" }