Debug::toStr()

Dump any variable to a debug string

Available since version 3.0.208.

Usage

// basic usage
$string = Debug::toStr($value);

// usage with all arguments
$string = Debug::toStr($value, array $options = []);

Arguments

NameType(s)Description
$valueint float object string array
$options (optional)array
  • method (string): Dump method to use, one of: json_encode, var_dump, var_export, print_r Default:json_encode
  • html (bool): Return output-ready HTML string? Default:false

Return value

string


Debug methods and properties

API reference based on ProcessWire core version 3.0.251