<td><b>Description</b></td> <td><b>Formats</b></td> </tr> <?php foreach ($formats as $id => $data) { ?> <tr> <td><?php echo $data["name"]; ?> </td> <td><?php echo $data["desc"]; ?> </td> <td><?php echo movie_tools::formats_array_to_string($data["types"]); ?> </td> </tr> <?php } ?> </table> </p> <?php echo $form; ?> </div>
/** * Wrapper around formats_array_to_string() to convert straight from json and handle empty inputs. */ static function formats_json_to_string($input) { if ($input) { return movie_tools::formats_array_to_string(json_decode($input, true)); } else { return ""; } }