Read the thread. The original posts, show how to return the array from PHP to JavaScript using json_encode, the rest simply shows how to read the value in JavaScript.
If you have code, post it and we can help you out.
As then you can access the data using the following:
<script type="text/javascript">
$(document).ready(function(){
$("#boton").click(function(){
var campo = 'rut_consulta='+ jQuery("#rut_consulta").attr("value");
$.ajax({
type : "POST",
url : "scripts/search_workers.php" ,
traditional : true,
data : campo,
success : function(arrayPHP){
$("#rut").val(arrayPHP['rut']); // if that doesn't work, try arrayPHP.rut, but I believe the original way I wrote it should work
$("#nombre").val(arrayPHP['nombre']); // if that doesn't work, try arrayPHP.nombre
}
});
})
})
</script>
You may need to tell $.ajax the type of response being returned using
<script type="text/javascript">
$(document).ready(function(){
$("#boton").click(function(){
var campo = 'rut_consulta='+ jQuery("#rut_consulta").attr("value");
$.ajax({
type : "POST",
url : "scripts/search_workers.php" ,
traditional : true,
data : campo,
type : "json", // added this line
success : function(arrayPHP){
$("#rut").val(arrayPHP['rut']); // if that doesn't work, try arrayPHP.rut, but I believe the original way I wrote it should work
$("#nombre").val(arrayPHP['nombre']); // if that doesn't work, try arrayPHP.nombre
}
});
})
})
</script>
Likewise, you could also set the mime type of your json output to tell jQuery what to use