My arrays
a:3:{s:6:"Choice";a:2:{i:0;s:5:"First";i:1;s:6:"Second";}s:5:"fcode";s:26:"form_rajas_exmsw2rpc81anlj";s:9:"useremail";s:26:"[email protected]";}
array (
'Choice' =>
array (
0 => 'First',
1 => 'Second',
),
'fcode' => 'form_rajas_exmsw2rpc81anlj',
'useremail' => '[email protected]',
)
my php code
$arrays = 'a:3:{s:6:"Choice";a:2:{i:0;s:5:"First";i:1;s:6:"Second";}s:5:"fcode";s:26:"form_rajas_exmsw2rpc81anlj";s:9:"useremail";s:26:"[email protected]";}';
$decode = unserialize($arrays);
foreach($decode as $key => $value) {
echo '<td width="100">' . $value . '</td>';
}
My Error is :
Notice: Array to string conversion in....
The first Values in Nested Array.
How to convert nested array as a Value?
I need to show like this,
<tr><td>First,Second</td><td>form_rajas_exmsw2rpc81anlj</td><td>[email protected]</td></tr>
echo '<pre>'; print_r( $decode ); echo '</pre>';. You can also make arecursion functionthat checks if the input is an array: ifso recall itself with that array, else print the string.