Find Jobs
Hire Freelancers

generación de JSON en base a un array asociativo -- 2

$10-30 USD

Completed
Posted over 4 years ago

$10-30 USD

Paid on delivery
Quiero generar un JSON con la data de un array. Este Json es el resultado que quiero: {"empresa":"{\"key_secret\":\"TkdGIZ0Uws4SSJJLwPjXJsMPwqUf7vo\",\"key_public\":\"jXCcRMrodhe83PCo35VXnyGn8pUewXwnP\",\"idenEmpresa\":\"70110747\"}", "cliente":"{\"firstName\":\"Joel \",\"lastName\":\"Tovar\",\"street1\":\"11 55-78 z30\",\"phone\":\"55554444\",\"country\":\"GT\",\"city\":\"Quetzaltenango\",\"state\":\"Quetzaltenango\",\"postalCode\":\"09001\",\"email\":\"jtovar@[login to view URL]\",\"ipAddress\":\"[login to view URL]\",\"Total\":\"2\",\"currency\":\"GTQ\",\"fecha_transaccion\":\"2019-05-07 14:53:06\",\"deviceFingerprintID\":\"\"}", "detalle":"[{\"id_producto\":6,\"cantidad\":\"1\",\"tipo\":\"producto\",\"nombre\":\"RINGTONE\",\"precio\":\"2\",\"Subtotal\":\"2\"}]", "tarjetaPagalo":"{\"nameCard\":\"Joel Tovar\",\"accountNumber\":\"40000000XXXXXX\",\"expirationMonth\":\"10\",\"expirationYear\":\"2022\",\"CVVCard\":\"827\"}"} Con esta data del array. $data=array("empresa"=>’array('idenEmpresa'=> 'B10747', 'key_public'=> 'jXCcRMrodhe83PCo35VXnyGn8pUewXwnP', 'key_secret'=> ‘TkdGIZ0Uws4SSJJLwPjXJsMPwqUf7vo’ )’,"cliente"=> ‘array( 'firstName'=> 'Juan',' lastName'=> 'Pérez', 'street1'=> '12 Avenida Zona 15 ', 'country'=> 'Guatemala', 'city'=> 'Guatemala', 'state'=> 'Guatemala', 'postalCode'=> '01015', 'email'=> 'perez@[login to view URL]', 'ipAddress'=> '[login to view URL]', 'Total'=> '70.00', 'fecha_transaccion'=> '2017-08-31 09:05:00' )’,"detalle"=>’array( 'id_producto' => 'P01', 'cantidad' => '2', 'tipo' => 'producto', 'nombre' => 'Hamburguesa', 'precio' => '35.00', 'Subtotal' => '70.00')’ ,"tarjetaPagalo"=>’array ( 'nameCard' => 'Juan Prez', 'accountNumber' => '1452411212111111', 'expirationMonth' => '09', 'expirationYear' => '2020', 'CVVCard' =>'010')’); El problema es que en el segundo array al momento de ponerle comillas simples se vuelve texto. y si le pongo comillas dobles de la misma manera queda en texto. Lo que pasa es que la estructura del array lleva estas comillas para que el JSON quede igual. ¿Me podes indicar como podria indicar el JSON correctamente ? adicional los valores de cada array serian variables de php
Project ID: 22635606

About the project

2 proposals
Remote project
Active 4 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hola. Te puedo ayudar. Contactate y armamos el JSON. Quizás quitando las comillas y apoyandonos en json_encode nos simplifique un poco las cosas. Saludos.
$20 USD in 1 day
5.0 (8 reviews)
3.6
3.6
2 freelancers are bidding on average $20 USD for this job
User Avatar
Hello, Greetings! ******************** I will SATISFY YOU******************** I will do my best for you. Looking forward to hearing from you and thank you for your consideration. Best Regards From RealMan!
$20 USD in 7 days
5.0 (4 reviews)
2.5
2.5

About the client

Flag of GUATEMALA
Guatemala City, Guatemala
5.0
1
Member since Nov 23, 2019

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.