I have this string:
"a:11: i:0;s:3:"191";i:1;s:3:"256";i:2;s:3:"247";i:3;s:3:"244";i:4;s:3:"257";i:5;s:3:"250";i:6;s:3:"253";i:7;s:3:"258";i:8;s:3:"261";i:9;s:3:"259";i:10;s:3:"542";}
I want to get the numbers that are in quotes ex: "191"
I've tried explode, but it cuts in places where it doesn't work for me. Neither split, up to strpos, but returns the position of the first match.
I would need something like what is between "%"
Try this:
Using this regular expression should return you an array with the numbers in quotes.
The format of that string you have is a
serialize
php. That is, a serialized array, but instead of using json, the php serialize function has been used. https://www.php.net/manual/en/function.unserialize.phpWhat you should do is de-serialize it:
With this, you will have in $cadena_array a php array, which you can access with the corresponding array indices.