PHP code example of nyratas / php-console-log

1. Go to this page and download the library: Download nyratas/php-console-log library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nyratas / php-console-log example snippets




use PHPConsoleLog\Service as Console;

Console::exec();

$myArray = ['one','two','three'];

Console::log($myArray);

/*
 * Remove the attribute :
 */

Console::setAttribute();
      // or
Console::setAttribute(false);


/*
 * Edit the attribute :
 */

      // simple attribute
Console::setAttribute('data-my-attribute');
      // attribute with value
Console::setAttribute('data-my-attribute','attribute-value');

add_action( 'wp_footer', function(){ Console::exec(); }, 100 );