V
V
Vasya Surname2015-06-11 13:07:20
PHP
Vasya Surname, 2015-06-11 13:07:20

How to decode string 'a:2:{i:0;s:12:"Sample array";i:1;a:2:{i:0;s:5:"Apple";i:1; s:6:"Orange";}}'?

Given a string like this 'a:2:{i:0;s:12:"Sample array";i:1;a:2:{i:0;s:5:"Apple";i:1; s:6:"Orange";}}' I can't make a normal array out of it. What does there is a site that easily turns it online into an array. But the functions by which it does this are not described. I really need help. var_dump(json_decode($json)); produces NUll

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
DevMan, 2015-06-11
@bazilio2010

ideone.com/onJwLh

V
Vasya Surname, 2015-06-11
@bazilio2010

Thank you!

A
Artur Nurullin, 2015-06-13
@Splo1ter

If this is issued by the API, then the programmer's hands should be torn off for this. it's not even json

T
theArckady, 2022-03-21
@theArckady

unserialize() - converts to an array

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question