Skip to content

Instantly share code, notes, and snippets.

@Javlopez
Created September 29, 2011 20:05
Show Gist options
  • Save Javlopez/1251779 to your computer and use it in GitHub Desktop.
Save Javlopez/1251779 to your computer and use it in GitHub Desktop.
Ejemplo de json en PHP
<?php
$array = array(
array(1,25),
array(2,50),
array(3,30),
);
$edades = json_encode($array);
$fam = json_decode($edades);
var_dump($fam);
foreach($fam as $edad)
{
echo "[ID:{$edad[0]}][EDAD:{$edad[1]}]";
echo "<hr>";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment