Perl 2 Dimensional Array Php Functions