Jump to content

Obter retorno correto de um array


Go to solution Solved by Kleverson Cruz,

Recommended Posts

Tenho um array em PHP que passo para JSON assim:

var passedArray = <?php echo json_encode($arrayDescProd); ?>;

 

quando escrevo assim:

document.write(JSON.stringify(passedArray[1]));

 

o retorno é esse:

{"0":"GOLDEN MEGA ADULTO 15 KG 7897348201090"}

 

Mas quero que seja somente assim:

GOLDEN MEGA ADULTO 15 KG 7897348201090

 

Como fazer?

 

Desde já agradeço.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...