doulaozhi6835 2014-08-22 23:04
浏览 35
已采纳

你怎么读这个php系列? [关闭]

I'm new to PHP and I really like the concept behind it. Would you be kind enough to explain to me how a line like this would be read?

if ($ThisOutput->result == "success")

In other words, what does that line above mean? How can I understand it?

Thanks!

========

Wow! Thank you to all who have answered! I totally understand this now! :-) I wish I could choose all three of you as the accepted answer, but I can only choose one. Good job ya'll!

  • 写回答

2条回答 默认 最新

  • duannengling4705 2014-08-22 23:09
    关注

    In php, variables are denoted by a $ prefix. Therefore, $ThisOutput is a variable.

    There are several types of variables. For variables of type stdClass (objects) their properties can be accesed with the -> operator.

    Your code is evaluating if the property 'result' for the object $ThisOutput has a value equal to the string "success".

    An if construct will execute a further command if the argument evaluates to true. So in this case, if $ThisOutput->result is "success" something will be executed, and it won't in any other case.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 制裁名单20240508芯片厂商
  • ¥20 易康econgnition精度验证
  • ¥15 线程问题判断多次进入
  • ¥15 msix packaging tool打包问题
  • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接