dongshuo1257 2016-07-31 11:29
浏览 19
已采纳

PHP Array工作作业

I have a homework for school in PHP arrays and there are some problem. I writing a torrent file info checker.

My code: echo var_dump( $torrent->content() );

And the output: array(1) { ["Mac OS X El Capitan 10.11.4 (15E65) Installer/Install OS X El Capitan.app.zip"]=> int(6205991074) }

How can I make this to list:

Mac OS X El Capitan 10.11.4 (15E65) Installer/Install OS X El Capitan.app.zip
<br>And More files...

And an other listing what listing statistics: My code: echo var_dump( $torrent->scrape() );

And the output:

array(1) { ["Mac OS X El Capitan 10.11.4 (15E65) Installer/Install OS X El Capitan.app.zip"]=> int(6205991074) } 
stats: array(1) { ["http://109.235.50.166:2710/scrape"]=> array(3) { ["complete"]=> int(98) ["downloaded"]=> int(11441) ["incomplete"]=> int(27) } } 

How can I order to:

Downloaded: 11441
Downloading: 27

Thank you mates!

  • 写回答

1条回答 默认 最新

  • dongqiang8683 2016-07-31 11:35
    关注

    Try Something like this:-

    List Of Files:-
    
    
    foreach($torrent->content() as $key => $value){
       echo $key."<br/>";
    }
    
    Status:-
    
    foreach($torrent->scrape() as $key => $value){
       echo "Downloaded:" $value['downloaded']."<br/>";
       echo "Downloading:" $value['incomplete']."<br/>";
    }
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)