This file contains hidden or 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 | |
/* -------------------------------------------------------------------------------------------------------------------------------- */ | |
/* [HTML fixer] PHP class taht clean & repair html code, unofficial copy of http://barattalo.it/html-fixer/ #php #class #HTMLrepair */ | |
/* -------------------------------------------------------------------------------------------------------------------------------- */ | |
class HtmlFixer { | |
/* USAGE: | |
$class = new HtmlFixer(); | |
$clean_html = $class->getFixedHtml($dirty_html); */ |
This file contains hidden or 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 | |
/* ---------------------------------------------------- */ | |
/* [Array 2 Table] HTML Generator #php #function #table */ | |
/* ---------------------------------------------------- */ | |
/** | |
* Generate a table from an array | |
* @see https://stackoverflow.com/questions/4746079/how-to-create-a-html-table-from-a-php-array | |
* |
This file contains hidden or 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 | |
/* ------------------------------------------------------------------- */ | |
/* [Backup mySQL & ZIP] Backup you mySQL Database #php #class #backup */ | |
/* ------------------------------------------------------------------- */ | |
// SETUP | |
$config = array( | |
'backup_version' => '1.0.0', // version of the backup app | |
'backup_db_host' => 'localhost', // the mySQL host name - most time localhost |
This file contains hidden or 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 | |
/* ------------------------------------------------------- */ | |
/* [Exeption] Custom Exceptions #php #class #errorhandling */ | |
/* ------------------------------------------------------- */ | |
interface IException { | |
/* Protected methods inherited from Exception class */ | |
public function getMessage(); // Exception message | |
public function getCode(); // User-defined Exception code |
This file contains hidden or 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 | |
/* ------------------------------------------------------------------------------------------------------ */ | |
/* [Avatar Generator] Make Avatar Image Tag or SVG from given Name or mail address #php #function #avatar */ | |
/* ------------------------------------------------------------------------------------------------------ */ | |
function avatar ($name, $type='', $size=64) { | |
/*TODO | |
Flat Hash (from http://flathash.com/) | |
Robot and monsters Hash (from https://robohash.org/) |
This file contains hidden or 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 | |
/* --------------------------------------------------------------------------------------------------------------------- */ | |
/* [Cronjob Returns] Returns of a Script that started via cronjob and processes background tasks #php #function #cronjob */ | |
/* --------------------------------------------------------------------------------------------------------------------- */ | |
// ...here the work is done... (use $status for feedback to browser) | |
if(php_sapi_name() == "cli") { | |
// if it is called over console maybe its a cronjob an no answer is given |
This file contains hidden or 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 | |
/* ------------------------------------------------------------------------ */ | |
/* [File Upload] HTML Form and Upload Script #function #upload #materialize */ | |
/* ------------------------------------------------------------------------ */ | |
$id = '4711'; // SETUP ID of the Upload Record | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> |
This file contains hidden or 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 | |
/* ----------------------------------------------------------------------------------- */ | |
/* [HTML Compress] This function can be used to minify HTML #php #function #HTMLminify */ | |
/* ----------------------------------------------------------------------------------- */ | |
function html_compress($url) { | |
/* | |
+ Remove white spaces and tags before and after HTML tags | |
+ Remove comments |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<meta name="viewport" content="width=device-width"> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>[SUBJECT]</title> | |
<style> | |
/* ------------------------------------- | |
RESPONSIVE AND MOBILE FRIENDLY STYLES | |
------------------------------------- */ |
This file contains hidden or 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 | |
/* --------------------------------------------------------------- */ | |
/* [Session Wrapper] A simple Session Wrapper #php #class #session */ | |
/* --------------------------------------------------------------- */ | |
include_once 'CustomException.php'; | |
if ( !class_exists('CustomException') ) { | |
class CustomException extends Exception {} |
OlderNewer