I create a symfony2 command with one argument. This argument is the result of serialize($array) function.
But, inside the command I'm not able to unserialize() the received argument, i always got an error:
Notice: unserialize(): Error at offset 5 of 48 bytes in ...
This is a example of the array i want to send to the command:
$array = array('key1' => '$value1', 'key2' => '$value2')
When i serialize the array (serialize($array)) this is the result:
I was thinking: maybe the problem is due to double quotes in the string (remember, is to send to a command as parameter), then, i apply the addslashes function:
This is the result:
but im still receiving the same error when i try to unserialize the string inside the command execute() function.