LEPTON CMS 7.0.0
feel free to keep it strictly simple...
Loading...
Searching...
No Matches
lepton_tools.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
21{
27 static public bool $use_var_dump = false;
28
36 static public function use_var_dump(bool $bUseVarDump=true): void
37 {
38 self::$use_var_dump = $bUseVarDump;
39 }
40
63 static function display(mixed $something_to_display ="", string $tag="pre", string|null $css_class=null ): string
64 {
65 $s = "\n<".$tag.( NULL === $css_class ? "" : " class='".$css_class."'").">\n";
66 ob_start();
67 (true === self::$use_var_dump)
68 ? var_dump( $something_to_display )
69 : print_r( $something_to_display )
70 ;
71 $s .= ob_get_clean();
72 $s .= "\n</".$tag.">\n";
73
74 return $s;
75 }
76
90 // create signature image
91 static function base64ToImage(string $base64_string, string $output_file): string
92 {
93 $file = fopen($output_file, "wb");
94
95 $data = explode(',', $base64_string);
96
97 fwrite($file, base64_decode($data[1]));
98 fclose($file);
99
100 return $output_file;
101 }
102}
static display(mixed $something_to_display="", string $tag="pre", string|null $css_class=null)
static use_var_dump(bool $bUseVarDump=true)
static bool $use_var_dump
static base64ToImage(string $base64_string, string $output_file)