Reading boolean correctly from Postgres by PHP

后端 未结 4 1148
野性不改
野性不改 2021-02-14 14:58

The main problem of this thread is moved to here about boolean datatype in PHP / Postgres.

The problem is the conversion of t and f to

4条回答
  •  粉色の甜心
    2021-02-14 15:42

    This isn't a direct answer to the question, but here's an example demonstrating that pg_*() functions do in fact return the postgres boolean true value as the PHP string 't':

    [example]$ cat scratch.php 
    
      array(1) {
        ["true"]=>
        string(1) "t"
      }
    }
    bool(true)
    [example]$
    

提交回复
热议问题