これは私のURLリンクであり、デバイスはブラウザ本体の対応する値を返します。今私はこのデータをデータベーステーブル名 "IpRelay"に挿入します。最初に私はデバイスの返品データを爆発させます。次に、私は分解されたデータを挿入しようとしています。URLからデータベースにデータを挿入するには
ここに私のコードです。しかし、それは動作しません。
public function get_data(){
$contents = file_get_contents('http://10.5.40.83');
function multiexplode ($delimiters,$string) {
$ready = str_replace($delimiters, $delimiters[0], $string);
$launch = explode($delimiters[0], $ready);
return $launch;
}
$get_device_data = multiexplode(array(",",":",), $contents);
$this->IpRelay->create();
$this->IpRelay->set($this->request->data['get_device_data']);
$save = $this->IpRelay->save();
echo $save ? "I've created the link" : "Error creating link!";
die($this->IpRelay->id);
}
私はケーキで新しく、ケーキバージョン2.7.5を使用しています。 お願いします。 Thanksにおけるadvance
[
url=> http://10.5.40.83/
device return value=> 10,5,40,83:0,11,0,0,556
][1]