This is my url link and device return corresponding value in browser body. Now I insert this data into my database table name IpRelay. First I explode my device return data. Then I am trying to insert exploded data.
Here is my code. But it doesn't work.
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);
}
I am new in cakephp and I am using cake version 2.7.5. Would you help me please.
url=> http://10.5.40.83/
device return value=> 10,5,40,83:0,11,0,0,556
