My string :
a:3:{i:0;s:9:"John";i:1;s:9:"Doe";i:2;s:22:"Smith";}
I want to extract John, Doe, Smith
CodePudding user response:
If it's an original string that was serialized from an object, you can try to unserialize
it
$data = 'a:3:{i:0;s:4:"John";i:1;s:3:"Doe";i:2;s:5:"Smith";}';
print_r(unserialize($data));