I would imagine that splice[1] would take care of the first line but I'm not too familiar with PHP code. Start with this and go from there:
Code:
my @offset_correction = splice(@num_days_last_array, -$offset, $offset);
my @new_count = (@offset_correction, @num_days_array);
my $offset_count = @new_count;
# If you just need a count you *might* be able to get away with:
my $offset_count = (splice(@num_days_last_array, -$offset, $offset), @num_days_array));
see thats wot someone else said, but array_slice and array_splice are 2 different things in PHP, so if you look at the description for array_slice in the PHP manual (http://php.net/array-slice) you will it does a different thing to splice...
__________________ Alexa Share <-- Trade virtual shares in websites with this online game.
codR.us <-- Submit and vote for your favorite code snippets with codR.us.
it looks like that is just going to reverse your array, no? It really depends on the value of $offset though. In list context, splice will do the same as array_slice long as you only provide 3 args to the function. The fourth arg would be inserted at the splice point making it more like PHP's array_splice.
Can you explain in words the problem you are trying to solve? My problem is that I can't figure out exactly what you are trying to do with that snippet of code.