I have uploaded my project to a server, and now it is giving me problems, which can be ?, in local the project runs perfectly. this is the code of my function
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Gateway extends Model
{
function _doPost($query) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://secure.nmi.com/api/transact.php");
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POSTFIELDS, $query);
curl_setopt($ch, CURLOPT_POST, 1);
if (!($data = curl_exec($ch))) {
return ERROR;
}
$wm_string = iconv("windows-1251", "UTF-8", $data);
parse_str(urldecode($wm_string), $result);
$data=json_encode($result, JSON_UNESCAPED_UNICODE);
curl_close($ch);
unset($ch);
$this->datos=$data;
return $this->datos;
}
}
the error is
Call to undefined function App\iconv() in this line
$wm_string = iconv("windows-1251", "UTF-8", $data);
can be this a server problem? or maybe I must to download some package to my project?