質問

I have a Type Length Value string:

a:4:{s:5:"value";s:4:"0.00";s:4:"type";N;s:12:"discounttype";s:10:"Percentage";s:13:"configoptions";N;}

Is it possible to convert it to PHP array or JSON string?

役に立ちましたか?

解決

That kind of string could be done with unserialize() function. Also there is an article about that solving your needs here.

After it has been unserialized, it is an array. You can then convert using json_encode() function.

If you need extra help, write a comment

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top