我会给我的问题一个非常详细的基础。下载文件到服务器用PHP然后分离文件的内容
首先,我试图使用RuneScape Highscore API创建一个家族查找。
要生成特定家族的用户列表中,你需要去这个网站:http://services.runescape.com/m=clan-hiscores/members_lite.ws?clanName=X
一旦去这个网站,它会启动下载的文件本页面。当打开时,它是由逗号分隔的,因此看起来像这样:
Clanmate, Clan Rank, Total XP, Kills
Kol,Owner,214278437,10
Biteem,Deputy Owner,709189979,39
KitKatKiller,Deputy Owner,267880637,1
Spooky,Deputy Owner,692887397,773
Ghost Team,Overseer,1333197602,323
Yamilla,Overseer,1873041891,56
要说明什么,我想做的事,是我想要的用户键入一个名称的战队,然后当他们点击提交,供它将文件下载到MY文件服务器,然后显示.ws文件的内容,但忽略Clanmate列中的所有内容。
因此,举例来说,如果在公会名称输入的用户“刷爆”我想让它显示:
Kol
Biteem
KitKat
Spooky
Ghost Team
Yamilla
我有一个起点PHP代码,但是我不知道如何下载文件,或者分离.ws文件的每个内容,然后在页面上显示所有这些名称。
<?php
session_start();
if ($_POST['submit']) {
//This should be changed to downloading the file to the file server
//But this is the format that the link should be.
header('Location: http://services.runescape.com/m=clan-hiscores
/members_lite.ws?clanName='.$_POST['clanname']);
}
?>