Last active
February 15, 2018 02:04
-
-
Save crock/fbc1e8a4b820fa4d530cab1a7fb53ace to your computer and use it in GitHub Desktop.
My personal collection of utility functions for PHP
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class accorelib { | |
/** | |
* Prints out contents of variable surrounded with <pre> tags for easier analysis | |
* | |
* @param [Any] $variable - the variable to print out to page | |
* @return void | |
*/ | |
public function pretty_dump(Any $variable) { | |
echo '<pre>' . var_dump($variable) . '</pre>'; | |
} | |
/** | |
* Reads whole file and returns content | |
* | |
* @param String $filename | |
* @return void | |
*/ | |
public function read_file(String $filename) { | |
$fx = fopen($filename, 'r'); | |
$content = fread($fx, filesize($filename)); | |
fclose($fx); | |
return $content; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment