Skip to content

Instantly share code, notes, and snippets.

@nezarfadle
Last active April 2, 2020 04:39
Show Gist options
  • Save nezarfadle/b719c95f783515f77193517ab89cf9d3 to your computer and use it in GitHub Desktop.
Save nezarfadle/b719c95f783515f77193517ab89cf9d3 to your computer and use it in GitHub Desktop.
<?php

$list = [ 1, 2, 3, 4, 5 ];

function dumpArray( array $list )
{
    foreach ( $list as $key => $value )
    {
        printf( "%s[ %d ] %s -> %s %d \r\n", "\e[1m\e[92m", $key, "\e[34m", "\e[31m", $value );         
    }
}

dumpArray( $list );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment