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 toString($value): string
{
return trim(var_export($value, true), "'");
}
$data = [
'hello' => 'world',
'is' => true,
'nested' => ['count' => 5],
];
foreach ($data as $sub) {
if (in_array($sub)) {
return toString($sub);
}
}
echo $data;