You could have just fucking googled it: https://stackoverflow.com/questions/7490488/array-to-string-php
PHP is shit, but not being able to implicitly treat an array like a string is a good thing. And note that threads there are arrays of arrays, so you have to actually parse the structure to get what you want. You can implode it (which is basically an array join) or you can convert it back to json or something. I'd recommend using classes to properly build an object hierarchy. If you're lazy, you can just extract exactly what you need:
<?php
$url = "https://8ch.net/b/1.json";
$json = file_get_contents($url);
$json_data = json_decode($json,true);
// Get either the subject or the first 30 characters of the post
$get_title = function($thread) {
$post = $thread['posts'][0];
if (isset($post['sub'])) {
return $post['sub'];
} else {
return substr(strip_tags($post['com']), 0, 30);
}
};
echo "Threads: <br>" . implode("<br>", array_map($get_title, $json_data["threads"])) . "<br>";
?>
Holy shit PHP sucks, though.