I'm having problems with the php array_diff_assoc function, it gives me the error
" Notice : Array to string conversion in"
The code is as follows:
static public function ctrMostrarConceptosLiquidarDistintos($item, $valor, $datos){
$tabla = "Concepto";
$listaConceptos = json_decode($datos, true);
$nuevaLista = array();
$nuevosValores = array();
foreach ($listaConceptos as $key => $value) {
if ($value["Fijo"] == "N") {
$dtConceptos = array("ConceptoID" => $value["ConceptoID"],
"Descripcion" => $value["Descripcion"]);
array_push($nuevaLista, $dtConceptos);
}
}
$traerConceptos = ModeloPayment::mdlMostrarConceptosLiquidar($tabla, $item, $valor);
foreach ($traerConceptos as $key2 => $value2) {
$dtConceptos = array("ConceptoID" => $value2["ConceptoID"],
"Descripcion" => $value2["Descripcion"]);
array_push($nuevosValores, $dtConceptos);
}
$felec = array_diff_assoc($nuevosValores, $nuevaLista);
return $felec;
}
When the array $ listConcepts is empty, the array_diff_assoc function works and it returns an array, but when the array $ listConcepts has a value it gives me that error, which could be wrong?