duanmianhong4893 2015-06-18 04:27
浏览 29

从数组中获取Url以进行自动重定向

I'm getting response from webservice.This is for response:

$endpoint = 'http://.....';       
$mynamespace = 'http://........';
$client = new nusoap_client($endpoint, true);
$response = $client->call('SaleWithTicket', $param, $mynamespace);

And if I print it I'm getting this result

Array
(
    [SaleWithTicketResult] => Array
        (
            [TicketObjectId] => e1f511a8-610c-4db9-8c22-1effaf4c9ad9
            [TransactionDate] => 2015-06-18T07:00:18.9651562+03:00
            [StatusCode] => 0
            [RedirectUrl] => https://.........
        )

)

These are dynamic structered.

I want auto redirection however I couldn't find a way to go.

  • 写回答

1条回答 默认 最新

  • doutang7414 2015-06-18 04:44
    关注
    $location=$response['SaleWithTicketResult']['RedirectUrl'];
    header("Location: $location");
    

    What's hard there? And if that $result doesn't follow a defined structure and can be in a totally different format on a different day then whatever solution you come up with will be just a hack.

    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入
  • ¥20 XP系统在重新启动后进不去桌面,一直黑屏。
  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型