I need to pass array of hash references to php so that php can used that data.
What I doing?
I am serializing perl array of hash references using PHP::Serialize module and storing into database. But while reading it i am facing issue.
#!/usr/local/bin/perl
use PHP::Serialization qw(serialize unserialize);
my @rss_feed_result = ({
'data'=> 'here',
'id'=> 1,
},
);
my $rss_feed_result = serialize(\@rss_feed_result);
//storing it to database then
Now I am reading the same data in php by unserialize it and getting below output after unserialize which is not proper.
<?php
.....read data from database into $perl_serialize_data
$perl_serialize_data = "HERE PERL SERIALIZE DATA";
print_r(unserialize($perl_serialize_data));
?>
Below is the output.
(
[0] => {
[1] => 'data'=>
[2] => 'here',
[3] => 'id'=>
[4] => 1,
[5] => },
)
How to fix this?