Domanda

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?

È stato utile?

Soluzione

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top