Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

miyagawa (1653)

miyagawa
  (email not shown publicly)
http://bulknews.vox.com/
AOL IM: bulknews (Add Buddy, Send Message)

Journal of miyagawa (1653)

Sunday October 10, 2004
12:43 PM

PHP::Session array issue

[ #21281 ]

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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.