1

How to get json values from url

url:

admin-ajax.php?action=cfdb-login&cfdb-action=cfdb-export&form=contact%20form%20mail&enc=JSON&user_login=admin&user_password=admin

Content:

values
[
{"Submitted":"2014-11-06 10:44:29 +00:00","your-name":"ayyan","your-email":"test@mail.com","your-subject":"demo testing","your-message":"ayyantesting","Submitted Login":"admin","Submitted From":"127.0.0.1"},
{"Submitted":"2014-11-06 08:31:32 +00:00","your-name":"demo","your-email":"demo@mail.com","your-subject":"demo testing","your-message":"test the demo details","Submitted Login":"admin","Submitted From":"127.0.0.1"},
{"Submitted":"2014-11-06 08:18:26 +00:00","your-name":"ayyan","your-email":"test@mail.com","your-subject":"downloading hotel website","your-message":"test","Submitted Login":"admin","Submitted From":"127.0.0.1"}
]

i need to use this data to my current site.

fejese
  • 4,601
  • 4
  • 29
  • 36

1 Answers1

1
$url = "htp://www.example.com". /* Don't forget the http www part! */
    "admin-ajax.php?action=cfdb-login&cfdb-action=cfdb-export&form=contact%20form%20mail&enc=JSON&user_login=admin&user_password=admin";
$variable = json_decode(file_get_contents( $url ));
print_r($variable);
David162795
  • 1,846
  • 3
  • 15
  • 20