doulao7572 2011-11-24 11:08 采纳率: 0%
浏览 66
已采纳

如何打印paypal返回数组

I am using Martin Maly's Paypal Library and everything works properly.The thing I could not manage to do is I get something like this in the returning page;

   Array
(
    [TOKEN] => EC-49D73912N5410881H
    [TIMESTAMP] => 2011-11-24T10:59:46Z
    [CORRELATIONID] => 328dc8f80aac
    [ACK] => Success
    [VERSION] => 52.0
    [BUILD] => 2271164
    [EMAIL] => hello_1321870042_per@blablabla.com
    [PAYERID] => QZNN94QVUSL88
    [PAYERSTATUS] => verified
    [FIRSTNAME] => Test
    [LASTNAME] => User
    [COUNTRYCODE] => FR
    [CUSTOM] => 20|EUR|
)

And I want all these data to be printed seperately such as;

echo $array['EMAIL'];

This is the first time I work with arrays and I have no idea how to deal with it? I would be very glad if anyone out here help me. Thanks.

  • 写回答

2条回答 默认 最新

  • douqiang5933 2011-11-24 11:13
    关注

    You can either do:

    print_r($array);
    

    or if you want it more readable:

    foreach ($array as $key => $value) {
        echo "$key: $value
    ";
    }
    

    or this if you want to output some array values but not others:

    $output_these_keys = array('FIRSTNAME', 'LASTNAME', 'CUSTOM');
    foreach ($array as $key => $value) {
        if (in_array($key, $output_these_keys)) echo "$key: $value
    ";
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端