PHP Variable Display in Web and CLI: Display the highlighted value of a given variable

Recommend this page to a friend!
  Info   View files View files (5)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2021-02-26 (1 month ago) RSS 2.0 feedNot yet rated by the usersTotal: 105 All time: 9,403 This week: 258Up
Version License PHP version Categories
boh-basic-output-han 1.0.5GNU General Publi...7.4HTML, PHP 5, Debug, Utilities and Tools
Description Author

This class can display the highlighted value of a given variable.

It takes the value of a given variable and renders it as code to display in an HTML or CLI page.

The value of the variable is highlighted with format and colors to make it more readable by the Programmer.

Picture of Francisco Nez
  Performance   Level  
Name: Francisco Nez <contact>
Classes: 2 packages by
Country: Panama Panama
Age: 34
All time rank: 42293 in Panama Panama
Week rank: 265 Up1 in Panama Panama Up

Details

[BOH] Basic Output Handler for PHP

GitHub license State <!-- __SEMANTIC_VERSION_LINE__ --> GitHub issues Minimum PHP version

Acronym: [BOH].

Name: Basic Output Handler.

Dependencies: Stand Alone / PHP v7.4.

What does [BOH] do?

[BOH] is a very simple PHP [output handler] implementation that show Human readable information instead of using the default PHP options:

  • var_dump() - Displays information about a variable.
  • print_r() - Print human-readable information about a variable.
  • debug_zval_dump() - Outputs a string representing an internal value of zend.
  • var_export() - Print or return a string representation of a parseable variable.

This means that all the data passed is presented to the developer according to the chosen parameters. It also means that the displayed data can be directly reused as code. Comments are also generated for each value that briefly explains the type of data

Why use [BOH]?

Developers need the ability to decide how their code behaves when data needs to be checked. The native php Methods provide a range of information that is not reusable by the Developer or may even require more work to get the correct output for data verification.

This library handles data output proven to be extremely effective. [BOH] is a Standalone implementation that can be used for any project and does not require a third-party library or software.

Help to improve [BOH]?

if you want to collaborate with the development of the library; You can express your ideas or report any situation related to this in: https://github.com/arcanisgk/BOH-Basic-Ouput-Handler/issues

[BOH] Configuration:

None necessary.

[BOH] Installation:

composer require arcanisgk/boh-basic-ouput-handler
or 
composer require arcanisgk/boh-basic-ouput-handler --dev

[BOH] Usage:

Instance of Class


use \IcarosNet\BOHBasicOuputHandler as Output;
require __DIR__.'\..\vendor\autoload.php';
$output = new Output\Output_Handler();

Customiced colors palette:


//you can define the theme to be used in the output in web or cli:
$output = new Output\Output_Handler('monokai'); //in the class Instance or
$output->Theme('monokai');                      //call the method Theme

Options for Method:


$output->output($example_array);            // send the variable and library would check the best output for you.
$output->output($example_array,'web');      // or send a second argument for enviroment 'web' or 'cli'.
$output->output($example_array,'web',true); // if you need retrive the string instead of output send true in thirt param.
$output->output($example_array,'cli');      // the library support output for CLI enviroment.
$output->output($example_array,'cli',true); // an cli can retrive strings.

Example output:

Image of Example Output

Unit Test for output:

Unit test Pending for version v1.1.0

Contributors

  • (c) 2020 - 2021 Walter Francisco Nez Cruz icarosnet@gmail.com Donate

I want to give special credit to the Help, Collaboration and Support of the programmers fron php.net, StackExchange Community and Reddit(/r/PHPhelp/):

  • Mr_What4 (Reddit)
  • CyberJack77 (Reddit)
  • requinix (PHP.net)
  • patricio-moracho (SOes)
  • quevedo (SOes)
  • mauricio-contreras (SOes)
  • gbianchi (SOes)
  • Triby (SOes)
  • Marcos (SOes)
  • anythingg (SOes)
  • mdfst13 (CodeReview SE)
  • S?? On??? (CodeReview SE)
  • mast (CodeReview SE)
  • der-kommissar (CodeReview SE)
  • peilonrayz (CodeReview SE)

Those who have supported me in this project in an invaluable way, Greetings Guys.

  Files folder image Files  
File Role Description
Files folder imageexample (1 file)
Files folder imagesrc (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  example  
File Role Description
  Plain text file index.php Class Class source

  Files folder image Files  /  src  
File Role Description
  Plain text file OutputHandler.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:105
This week:0
All time:9,403
This week:258Up

For more information send a message to info at phpclasses dot org.