小编Bul*_*fen的帖子

Php时间和手动设定时间值.伯爵

今天扭曲了我的大脑并做了一些搜索,但没有找到任何好的答案.看看我的例子吧.

$time_now = date("H:i:s"); // The current time. (let's say the clock is 14:25:33)
$time_visited = "14:23:33"; // the time page was visited. (set by cookie)
Run Code Online (Sandbox Code Playgroud)

所以,假设我想在$ time_visited和$ time_now之间获得时间(应该是120秒)什么是在这些值之间获得/计算第二的最简单方法?

php time count

0
推荐指数
1
解决办法
216
查看次数

JSON使用PHP获取选定的值

一直在寻找关于这个的stackoverflow所以我确实试图让这个正确.不知道我在这里做错了什么.有什么建议?

 <?php
    $string = '{
    "status": "success",
    "th_size": "small",
    "users": [
        {
            "user_id": 159826,
            "username": "WillBeUsed",
            "online": true,
            "is_away": false,
            "access": "public",
            "render_info": {
                "profile_url": "/person1",
                "profile_image": "11e5a496f13366a0c4ce000403aa862",
                "language": "english",
                "chat": "ready"
            },
            "new": false,
            "back": false
        }
    ],
    "online_count": 1
}';
    $result = json_decode($string, true);

//echo $result['status']; // This works
echo $result->users[0]->render_info->profile_url; // This don't work
    ?>
Run Code Online (Sandbox Code Playgroud)

php json

0
推荐指数
1
解决办法
508
查看次数

标签 统计

php ×2

count ×1

json ×1

time ×1