Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/12/2010, 12:33
walterdevel
 
Fecha de Ingreso: diciembre-2010
Mensajes: 788
Antigüedad: 13 años, 4 meses
Puntos: 51
Respuesta: Call to undefined function json_encode()

Te paso una solución, aunque debería tener esta función:

Fuente: php.net

For JSON support in older versions of PHP you can use the Services_JSON class, available at http://pear.php.net/pepr/pepr-proposal-show.php?id=198

Código PHP:
<?php
if ( !function_exists('json_decode') ){
    function 
json_decode($content$assoc=false){
                require_once 
'Services/JSON.php';
                if ( 
$assoc ){
                    
$json = new Services_JSON(SERVICES_JSON_LOOSE_TYPE);
        } else {
                    
$json = new Services_JSON;
                }
        return 
$json->decode($content);
    }
}

if ( !
function_exists('json_encode') ){
    function 
json_encode($content){
                require_once 
'Services/JSON.php';
                
$json = new Services_JSON;
               
        return 
$json->encode($content);
    }
}
?>
PD: esto es de lo que hablaba masterpuppet


Ya lo he tenido que usar y funciona 100%