Ver Mensaje Individual
  #5 (permalink)  
Antiguo 03/05/2016, 12:28
Avatar de kip13
kip13
 
Fecha de Ingreso: agosto-2011
Mensajes: 167
Antigüedad: 12 años, 8 meses
Puntos: 13
Respuesta: Mostrar desde un json

Código PHP:
<?php
$json
='{"video": {
    "duration": "3:10",
    "views": "333249",
    "video_id": "44bc40f3bc04f65b7a35",
    "rating": "74.17",
    "ratings": 391,
    "title": "Titulo",
    "url": "http://prueba.com/videoprueba",
    "default_thumb": "http://imagen.com",
    "thumb": "http://imagen.com/70.jpg",
    "publish_date": "2008-03-28 13:59:35",
    "thumbs": [
      {
        "size": "large_hd",
        "width": "320",
        "height": "180",
        "src": "http://prueba.com/imagen/1.jpg"
      },
      {
        "size": "large_hd",
        "width": "320",
        "height": "180",
        "src": "http://prueba.com/image2/2.jpg"
      }
    ],
    "tags": [
      {
        "tag_name": "video"
      },
      {
        "tag_name": "tecnologia"
      },
      {
        "tag_name": "it"
      }      
    ],
    "autor": [
    ]  
    } 
}'


$array=(array) json_decode($json);
echo 
$array['video']->url;

?>
Pruebalo y nos comentas.

Saludos

Última edición por kip13; 03/05/2016 a las 12:43