$object * * @return string */ public static function arrayToEscapedJson($object = []): string { $json = json_encode($object); if (empty($json)) { return ''; } $json = str_replace('"', '"', $json); return $json; } /** * @param string $json * * @return array */ public static function escapedJsonToArray($json): array { $array = str_replace('"', '"', $json); $array = json_decode($array, true); return $array; } }