forumnz Posted May 8, 2009 Share Posted May 8, 2009 I am trying to echo the output of a script that posts to a PHP file. <?php $data = $_POST['data']; $form = $_POST['form']; $data = stripslashes($data); $data = var_dump(json_decode($data, true)); echo $data; It displays nothing.. why is this? Link to comment https://forums.phpfreaks.com/topic/157302-solved-problem-with-json_decode/ Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 You idiot. Read var_dump It doesn't return anything. Take out var_dump. Link to comment https://forums.phpfreaks.com/topic/157302-solved-problem-with-json_decode/#findComment-829096 Share on other sites More sharing options...
forumnz Posted May 8, 2009 Author Share Posted May 8, 2009 Yes thank you Ken2k7 I just did that (before your comment), but I still only get "Array" Why? Thanks ??? Link to comment https://forums.phpfreaks.com/topic/157302-solved-problem-with-json_decode/#findComment-829099 Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 Because it's an array? Use: var_dump($data); or print_r($data); Link to comment https://forums.phpfreaks.com/topic/157302-solved-problem-with-json_decode/#findComment-829101 Share on other sites More sharing options...
forumnz Posted May 8, 2009 Author Share Posted May 8, 2009 Thank you Link to comment https://forums.phpfreaks.com/topic/157302-solved-problem-with-json_decode/#findComment-829104 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.