Hi! Could we please enable some services and cookies to improve your experience and our website?
Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code
<?php
function split_json($json) {
$json_size = strlen($json);
$json_parts = array();
if ($json_size > 30) {
$json_parts = array_chunk(json_decode($json), ceil($json_size / 30));
}
return $json_parts;
}
var_dump(split_json('[{"hello":"world"},{"foo":"bar"}]'));