-5

I have an complex json, I cant change it to php object, I tried json_decode() put nothing get.

This is the json:

a:2:{s:9:"Education";a:5:{s:12:"EntranceDate";a:1:{i:1;s:11:"2009-09-01 ";}s:14:"GraduationDate";a:1:{i:1;s:11:"2015-09-13
";}s:15:"InstitutionName";a:1:{i:1;s: قابوس السلطان جامعة": 36 ";}s:5:"Major";a:1:{i:1;s: الحاسب علوم": 32
2015-10-01":11:s;1:i}:2:a;"StartDate":9:s}:6:a;"WorkExperience":14:s{{;"643":3:s;1:i}:1:a;"DegreeLevel":11:s{;" الآلي
";i:2;s:11:"2015-11-01 ";}s:7:"EndDate";a:2:{i:1;s:11:"2015-11-30 ";i:2;s:11:"2015-11-30
";}s:8:"JobTitle";a:2:{i:1;s: مبرمج": 10 ";i:2;s: مصمم": 8 ";}s:11:"CompanyName";a:2:{i:1;s: للتجارة القمه": 48
46 :"المدارات الرقمية :s;2:i;" الإلكترونية
":79:s;1:i}:2:a;"Description":11:s{;"499":3:s;2:i;"515":3:s;1:i}:2:a;"Industry":8:s{;" شركة القمه للتجاره الإلكترونيةالشاملة
Apex";i:2;s: إلكترونية مواقع مصمم": 46 Digital";}}}

any helps ??

  • 6
    That is not JSON. It's serialized using http://php.net/manual/en/function.serialize.php – PeeHaa Nov 11 '15 at 08:12
  • 1
    Possible duplicate of [How to use php serialize() and unserialize()](http://stackoverflow.com/questions/8641889/how-to-use-php-serialize-and-unserialize) – swidmann Nov 11 '15 at 08:20

1 Answers1

2

What you have is a serialized array (with two elements), which is specified by the first three characters of the string you've got - a:2. Such a string is the return value of the built-in function serialize().

What you need to do to get an actual value (to assign a variable), is do unserialize() on your string.

Havelock
  • 6,913
  • 4
  • 34
  • 42
Andrius
  • 5,934
  • 20
  • 28