208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
*/
$xcampo = $valor->name;
$arr[]=$xcampo;
$pos=$pos+1;
}
$result = mysqli_query($db->getConnection(),$query);
$nbrows = mysqli_num_rows($result);
$limit = $query;
$result = mysqli_query($db->getConnection(),$limit);
$x=0;
$filas=0;
$filastotal=mysqli_num_rows($result);
if($nbrows>0)
{
echo '{"total":"'.$totalregistros.'","results":[';
while($rec = mysqli_fetch_array($result))
{
echo "{";
$x=0;
for ($xx=0;$xx<$num;$xx++)
{
//$arr[$xx] = trim(preg_replace(''/\s+/'', '', $arr[$xx]));
function limpiarString($texto)
{
$textoLimpio = preg_replace('([^A-Za-z0-9])', '', $texto);
          
return $textoLimpio;
}
echo '"'.utf8_encode(addslashes($arr[$xx])),'":';
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX