wilon/simple-php-debug

Simple PHP Debug,更好的输出和日志记录。

0.1.7 2017-04-14 10:37 UTC

This package is not auto-updated.

Last update: 2024-09-28 20:51:00 UTC


README

Packagist Packagist Release Packagist Downloads

Simple PHP Debug,在浏览器上提供更好的输出和日志记录。

安装与加载

只需将以下行添加到您的 composer.json 文件中

"wilon/simple-php-debug": "^0.1.7"

composer require wilon/simple-php-debug

一个简单的示例

<?php

$a = 123;
$b = '23333';

simple_dump($a, $b, $_GET, $_SERVER['REMOTE_ADDR']);

simple_log(dirname(__FILE__) . '/somefile.log', $b, $_GET, $_SERVER['REMOTE_ADDR']);

浏览器中的 var_dump 有什么更好的替代品吗?

<?php

$longStr = 'President Trump’s ouster of national security adviser Michael T. Flynn, and the circumstances leading up to it, have quickly become a major crisis for the fledgling administration, forcing the White House on the defensive and precipitating the first significant breach in relations between Trump and an increasingly restive Republican Congress.';
$htmlStr = '<link rel="search" type="application/opensearchdescription+xml" href="/search.osd?v=1483361432" title="Packagist" /><br>';
$array = pathinfo('C:/test/wilon/index.php');

var_dump($longStr, $htmlStr, $array);

simple_dump($longStr, $htmlStr, $array);

image