如何使用RapidShare的API来获取帐户资料? PHP的问题 [英] How to use rapidshare API to get Account Details ?? PHP question

查看:168
本文介绍了如何使用RapidShare的API来获取帐户资料? PHP的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到一个长的字符串是这样的:

I get a long string like this :

ACCOUNTID = *** 类型= $ P $点servertime = 1247000294更新时间= ****** validuntil = ****的 的用户名= 8 directstart = 1 protectfiles = 0 ...

accountid=*** type=prem servertime=1247000294 addtime=****** validuntil=**** username=8 directstart=1 protectfiles=0 ...

如何从它使用PHP获得价值观
我的意思是如何ACCOUNTID的值设置为一个变量?像$用户名= VALUE ACCOUNTID吗?
我试图strpos,但..我不知道如何得到它..请帮助我

how to get values from it using php ?? i mean how to set accountid's value to a variable ?? like $username = VALUE OF ACCOUNTID ? i tried strpos , but.. i dont know how to get it .. please help me

推荐答案

如果它就像你贴什么...

If it's just a plain string like what you posted...

    $url = "accountid=*** type=prem servertime=1247000294 addtime=****** validuntil=**** username=8 directstart=1 protectfiles=0";

    $temp = explode(' ', $url);
    foreach($temp as $k => $v)
    {
        $temp[$k] = explode('=', $v);
        $data[$temp[$k][0]] = $temp[$k][1];
    }
    unset($temp);

    $data["accountid"] // stores the account ID, equal to "***"
    $data["type"]      // stores the type, equal to "prem"
    //etc....

这将是略有不同的,如果它是一个真正的查询字符串,这可能是可能的。

这篇关于如何使用RapidShare的API来获取帐户资料? PHP的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆