duanpeng1532 2014-11-24 17:09
浏览 60
已采纳

Chrome开发者工具 - 控制台 - 您可以检查PHP var吗?

I'd like to know if there is a command line API from the Chrome Developer Tools in Console that can be used to view an object?

I'm not looking for something like console.log() which can be placed in the PHP code, but I need to view the variable after the page is rendered on a Production site.

Can this be done via the console?

inspect( {{ myArray }}) valueOf( {{ myArray }}) or values()

Thanks

  • 写回答

1条回答 默认 最新

  • duanlachu7344 2014-11-24 17:41
    关注

    No, you can't, but you are missing some basic coding and languages fundamentals, like the difference between compiled codes and scripting codes.

    In PHP you cannot debug the code in real time like in compiled codes, except if you configure your IDE (like PHPStorm) to make some real time debugging, but that is an advanced task.

    Supposing that you are coding on a localhost, what you can do is printing your variable with codes like:

    var_dump($your_variable);
    print_r($another_variable);
    

    and your values will be printed out, but you need to reload the page.

    If you are on a good mood, i recommend you take a look on this XDebug and PHPStorm Real time debugging article! .

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统