O url değişkenlerini gönderme ile bir url Sonuçlar Başlarken

0 Cevap

i need to send get command and take it's results. Sorry about my bad english.
i need to get result from a file whish sended url parameters for example:

<?php

$adata["command1"] = "testcommand1";
$adata["command2"] = "testcommand2";
$getresult = sendGetCommand("https://website.com/api.html", $arrayofdata);

echo "["; // for json data;

$arrayresult = explode("\n",$getresult);
foreach ($getresult in $line) {
  $arrayline = explode("\n",$line);
   echo "{ ";
  foreach ($arrayline in $cmdid => $cmd) {
    echo "'".$cmdid."' : '".$cmd."',";
  }
  echo "{";
}
?>

Böyle somethink ..

url is like:
"https://website.com/api.html?command1=testcommand1&command2=testcommand2"

url sonuç gibidir:


command1,testcommand1,,yes
command2,testcommand2,,error,error text here


i'll explode the data line by line and then get the data from JavaScript this is a domain search api.

another question: explode("\n",$string) can be used for read it line by line? (windows os)

0 Cevap