convert json data to string or array in php

Asked

Viewed 86 times

0

I have this json and would like to know how to convert it to an arrag/string

{'texto_mensagem': {'texto': 'Mensagem de envio'}, 'numero_celular': [{'numero': '5537988440956'}, {'numero': '5537988530808'}, {'numero': '5537988555533'}]}

My client is this

        $(function() {
        $.ajax({
            type: "post",
             data: "{'texto_mensagem': {'texto': 'Mensagem de envio'}, 'numero_celular': [{'numero': '5537988440956'}, {'numero': '5537988530808'}, {'numero': '5537988555533'}]}",
            contentType: "application/json; charset=UTF-8; charset=utf-8",
            dataType: "json",
            url: 'http://www.e-sms.com.br/api',
            success: function(data){
                console.log(data);
            },
            error: function (request){
                console.log(request);
            }
        });    
    });
Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.