what i'm trying data serialized data. got inputs power name, i'm trying make shows if user has power.
here serialized data
a:1:{s:6:"powers";a:1:{s:7:"profile";a:1:{s:3:"has";b:0;}}} trying has part of data gets name of power.
php code
foreach ($c['powers'] $a => $b) { echo $a; } the $c['powers'] start of serialize data can see here s:6:"powers"
let's see how looks unserialized:
var_export(unserialize('a:1:{s:6:"powers";a:1:{s:7:"profile";a:1:{s:3:"has";b:0;}}}')); outputs:
array ( 'powers' => array ( 'profile' => array ( 'has' => false, ), ), ) so 'has' => false not element of c['powers'] of $c['powers']['profile']
Comments
Post a Comment