PHP TP frame custom print function P

The following results, there is a gray background, a gray can be changed not necessarily

 

 

 

Code:

// pass the data to output format easy to read the style
function P ($ Data) {
// define the style
$ str = '<pre style = "display: block; padding: 9.5px; margin: 44px 0 0 0; font -size: 13px; line-height: 1.42857; color: # 333; word-break: break-all; word-wrap: break-word; background-color: # f5F5F5; border: 1px solid #CCC; border-radius: 4px; "> ';
// null if it is directly displayed text or boolean; otherwise Print
IF (is_bool ($ Data)) {
$ show_data Data = $?' to true ':' to false ';
} ELSEIF (is_null to ($ Data) ) {
$ show_data = 'null';
} the else {
$ show_data = print_r ($ Data, to true);
}
. $ = STR $ show_data;
. = STR $ '</ pre>';
echo $ STR;
}

 

Guess you like

Origin www.cnblogs.com/youantianqin/p/11832590.html