PHP::Session array issue
Someone has requested me to add a new feature to get PHP array back as a Perl array, in PHP::Session.
I think it can be done if we have a new method get_array()
, to implicitly get array variables as Perl arrray ref:> sub get_array {
my($self, $key) = @;
my $hashref = $self->get($key);
return [ map $hashref->{$}, sort { $a $b } keys %$hashref ];
} Additionaly, we can allow an object option (like auto_interpolate_array) to allow automatic conversion from PHP array to Perl array.
Suggestions are welcome.