man in white and blue crew neck t shirt holding blue and white love print
COMPARTE ESTE ARTÍCULO

En esta ocasión veremos cómo convertir nuestro array en PHP a JSON/XML. Para quiénes no lo sepan estas dos tecnologías es muy utilizada junto a los sockets. Para pasar de Array a JSON es

<?php
$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5);

echo json_encode($arr);
?

Para convertir de array a XML

Para convertir de Array a XML se usa:

<?php
include 'ejemplo.php';

$peliculas = new SimpleXMLElement($xmlstr);

echo $peliculas->pelicula[0]->argumento;
?>

Si necesitas ayuda con tu proyecto web, multiplataforma, servicio web, proyecto de universidad, o necesitas ayuda, aquí te vamos a ayudar a echar a andar tu proyecto web. Tenemos buenos profesionales, con años de experiencia, dispuestos a ayudarle.

FUENTES

https://www.php.net/manual/es/function.json-encode.php

https://www.php.net/manual/es/simplexml.examples-basic.php

man in white and blue crew neck t shirt holding blue and white love print
Photo by RealToughCandy.com on Pexels.com


NUESTRAS ÚLTIMAS PUBLICACIONES


Contenido restringido

Acceso de usuarios existentes

Demuestra que eres un ser humano


   
Registro de un nuevo usuario
*Campo necesario

Tags:

Comments are closed

Estado de acceso

Demuestra que eres un ser humano


ESTADO DE ACCESO

Demuestra que eres un ser humano


TRADUCTORES
COMPARTENOS
HTML Snippets Powered By : XYZScripts.com
Insert math as
Block
Inline
Additional settings
Formula color
Text color
#333333
Type math using LaTeX
Preview
\({}\)
Nothing to preview
Insert

Contenido Protegido

error: CONTENIDO PROTEGIDO