获取值stdClass对象PHP

获取值stdClass对象PHP

本文介绍了获取值stdClass对象PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用mp4数据提取php脚本.这将返回一个stdClass对象,如下所示.谁能告诉我如何从下面的对象显示持续时间.谢谢

I work with mp4 data extract php script. this returns a stdClass Object as below. can anyone tell me how to show the duration from below object.thank you

stdClass Object
(
    [hasVideo] => 1
    [hasAudio] => 1
    [video] => stdClass Object
        (
            [width] => 472
            [height] => 360
            [codec] => 224
            [codecStr] => H.264
        )

    [audio] => stdClass Object
        (
            [codec] => 224
            [codecStr] => AAC
        )

    [duration] => 622.8
)

推荐答案

您可以这样做:

echo $yourObject->duration;

这篇关于获取值stdClass对象PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 20:08