drob50257447 2018-10-08 15:10
浏览 22

Php不显示简单的对象变量

I have this object :

var_dump ($filtres) ; 

Result:

object(stdClass)[2]
  public 'filtres' => 
    object(stdClass)[3]
      public 'table' => string 'crm_comptes' (length=11)

I'm simply trying to echo it, it doesn't work :

echo $filtres->table;

It stays BLANK, I've tried plenty of things, like converting it to an array, all of that, it still doesn't want to display 'crm_comptes'

I've tried this :

echo $filtres['table'];

It still displays nothing.

Did I do something wrong?

  • 写回答

1条回答 默认 最新

  • dongzhaobai5982 2018-10-08 15:18
    关注

    As I have seen you output result, it seems your result $filtres is an object of an object for table. You should get it as:

    $filtres = $filtres->filtres;
    echo $filtres->table;
    
    评论

报告相同问题?