This code not working in Magento 2.2, But it's working in Magento 2.1. I am facing this error
Notice: unserialize(); Error at offset 0 of 168 bytes in /var/www/html/M2/app/code/Vendor/Module/Block/MyBlock.php
$infoRequest = $item->getOptionByCode('info_all')->getValue();
$addtoCartreqest = unserialize($infoRequest);
Best Answer
Read More: blog.mageprince.com
Inject
\Magento\Framework\Serialize\Serializer\Json
class for serialize and unserialize values.Now use
$this->serialize
As per Magento 2.2 Release Note