Your $this->text
is the result of a serialize()
run on an PHP array presumably to store it on a table column. It must therefore be unserialized()
back to a PHP array before you can make any use of it as a PHP array.
However, when I tried that there also appears to be errors in the original serialisation so as it is $this->text
is corrupt and unusable as it stands.
Having copied your serialized string from your question, when trying to unserialise it I get this error
$x = 'a:2:{i:0;a:2:{s:5:"value";s:2:"de";s:5:"label";s:70:"<img src="assets/images/e/de-02d3d6ee.jpg" width="40" height="28" alt="">";}i:1;a:2:{s:5:"value";s:2:"en";s:5:"label";s:70:"<img src="assets/images/7/en-c5c09767.jpg" width="40" height="28" alt="">";}}';
$y = unserialize($x);
print_r($y);
Notice: unserialize(): Error at offset 123 of 256 bytes in D:\PHP-SOURCE\tst.php on line 4
This is because this part of the string,
s:70:"<img src="assets/images/e/de-02d3d6ee.jpg" width="40" height="28" alt="">"
does not correctly count the following string, as there are 74 characters in the string
"<img src="assets/images/e/de-02d3d6ee.jpg" width="40" height="28" alt="">"
If we fix that by correcting the count to 74
like this
s:74:"<img src="assets/images/e/de-02d3d6ee.jpg" width="40" height="28" alt="">"
And rerunning the unserialise
$x = 'a:2:{i:0;a:2:{s:5:"value";s:2:"de";s:5:"label";s:74:"<img src="assets/images/e/de-02d3d6ee.jpg" width="40" height="28" alt="">";}i:1;a:2:{s:5:"value";s:2:"en";s:5:"label";s:70:"<img src="assets/images/7/en-c5c09767.jpg" width="40" height="28" alt="">";}}';
$y = unserialize($x);
print_r($y);
There is another similiar error in the string counts
Notice: unserialize(): Error at offset 248 of 256 bytes in D:\PHP-SOURCE\tst.php on line 8
s:70:"<img src="assets/images/7/en-c5c09767.jpg" width="40" height="28" alt="">"
So if we also fix that error by making the count 74
and rerun
$x = 'a:2:{i:0;a:2:{s:5:"value";s:2:"de";s:5:"label";s:74:"<img src="assets/images/e/de-02d3d6ee.jpg" width="40" height="28" alt="">";}i:1;a:2:{s:5:"value";s:2:"en";s:5:"label";s:74:"<img src="assets/images/7/en-c5c09767.jpg" width="40" height="28" alt="">";}}';
$y = unserialize($x);
print_r($y);
We get a correctly unserialised array like this
Array
(
[0] => Array
(
[value] => de
[label] => <img src="assets/images/e/de-02d3d6ee.jpg" width="40" height="28" alt="">
)
[1] => Array
(
[value] => en
[label] => <img src="assets/images/7/en-c5c09767.jpg" width="40" height="28" alt="">
)
)
So in short, if you got this data from a database You will need to look at the code that is serialising this data before it is placed on the database to work out why it is Incorectly serialising the array in the first place.