|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-11-17 22:49 UTC] sniper@php.net
[2001-11-18 05:03 UTC] deelee at fundy dot net
[2003-02-09 14:48 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 04:00:01 2025 UTC |
Using the file function, newlines (\n) are included in the read. The causes odd behaviour in other functions such as: mail - If the subject parameter is loaded using the file function, the newline causes the headers sent using mail to be invalid. In the case of Eudora the header information is dispalyed in the message and the From field displays the server account that generated the message - in my case "WWW User". array_search - All efforts to use this function fail with an array created with the file function. Only through the following cose will it produce the results expected: $someArray = str_replace (array("\r", "\n"), '', $someArray); (Thanks to Zak Greant for this code :) in_array - Much like array_search, the results are misleading due to the presence of newlines. A match is never found even though an echo of the array being tested looks identical to the target string/integer.