03/23/2018 at 4:42 pm
#456551
Keymaster
@ Randy
The data is json_encoded() faster for PHP to do and less prone to being broken. To decode, you can use nFormatting::maybeJSONdecode( $value ) where $value is the data from the options column.
Hope that helps!
ps. if you have old data, those might still be serialized. So it would be safer to do this:
$options = maybe_unserialize( $value );
$options = cnFormatting::maybeJSONdecode( $options );
That way if $value is serialized it will be unserialized. The cnFormatting::maybeJSONdecode() will simply pass the data back unaltered if the value is not json encoded. It’ll only take action if the value was json encoded. Hope that make sense!
