|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-08 12:10 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Sep 03 18:00:01 2026 UTC |
Description: ------------ I encountered this bug while reading out a CSV file. The problem here is the fact that PHP cannot parse True/False as a string in this situation. In the CSV file, rows are built like this: "True";"26631";"2";"6";"20040521";"2004";"null" When I loop through the rows, and echo the first value ($data[0]) it says "True" or "False", but when I try to use it in an if-statement, it will always go to the else section. Reproduce code: --------------- function convertBoolean($tring) { if($tring == 0) { $return = "1"; } else { $return = "0"; } return $return; }