notice: array to string conversion in php

后端 未结 2 2061
被撕碎了的回忆
被撕碎了的回忆 2021-02-10 09:53
prepare(\"SELECT p_id FROM players_to_team WHERE t_id = ?\");

    $t         


        
2条回答
  •  遇见更好的自我
    2021-02-10 10:33

    You cannot simply echo an array. echo can only output strings. echo 'foo' is simple, it's outputting a string. What is echo supposed to do exactly in the case of echo array('foo' => 'bar')? In order for echo to output anything here, PHP will convert array('foo' => 'bar') to a string, which is always the string "Array". And because PHP knows this is probably not what you want, it notifies you about it.

    The problem is you're trying to treat an array like a string. Fix that.

提交回复
热议问题