@Niush so, basically, it’ll be a screen for someone to enter an array(in php format). And when saved, it’ll go into a database(as json). But when the user views/edits/creates it, I need to show it to them as a php array.
I do have this now working with the eval function. And that works fine, but yeah, I am worried about the security issue. Although, only system administrators can get to this screen, so it’s not the end of the world doing it like that.
@TheoR I don't know your use case. But, wouldn't just allowing the person to input JSON be better. It is easy to learn and understand by anyone, and you can provide validation locally.
As @niush mentioned, it's better to save it in a proper format in the first place. You can either save it as json or use serialize(). But can easily and safely be converted back
it's better to save it in a proper format in the first place. You can either save it as json or use serialize(). but can easily and safely be converted back