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
/** | |
* Replaces occurance of userdefined docblocks within js sourcecode against HTML tags <pre><code>...</pre></code> | |
* | |
* Example: | |
* @xcode | |
* var foobar = 123456; | |
* /@xcode | |
* | |
* Will be replaced against: | |
* <pre><code> |
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
/** | |
* Builds the class tree, calls itself recursively, if a parent exists. | |
* | |
* @param string $name The name of class to create the tree from | |
* @param int $level Tree level | |
* @return string The string representation of the tree | |
*/ | |
function buildClassTree($name, $level=0){ | |
$prefix = str_repeat(' ', ($level * 2)); | |
$tree .= $prefix . $name . "\n"; |
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
/** | |
* Changes mode of folders/files recursively. | |
* | |
* @param string $dir The directory to change mode recursively | |
* @param int $dirMode Folder permissions to set | |
* @param int $fileMode File permissions to set | |
* @return void | |
*/ | |
function mp_recursiveChmod($dir, $dirMode=0775, $fileMode=0775) | |
{ |
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
/** | |
* Checks the existance of an ressource/file/url on a host (Linkchecker). | |
* | |
* Usage: | |
* <code> | |
* $url = 'http://www.google.de/?q=foobar'; | |
* $opt = array('timeout' => 3); | |
* $result = mp_urlCheck($url, $opt); | |
* if ($result == false) { | |
* echo 'ERROR: Errornumber: ' . $opt['errno'] . ', Errormessage: ' . $opt['errstr']; |
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
/** | |
* Checks HTTP Links. | |
* Based on function phpLinkCheck from Johannes Froemter <[email protected]>, 2001-04-14. | |
* | |
* Usage: | |
* <code> | |
* $url = 'http://www.google.de/?q=foobar'; | |
* $res = mp_linkCheck($url); | |
* | |
* // key 'Status-Code' will contain the HTTP status code (e.g. 200 or 404). |
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
/** | |
* Dumps the content of passed variable and returns the result. | |
* | |
* @param mixed $var The variable | |
* @param string $label Additional text to describe the variable | |
* @param bool $formatted Flag to return formated information | |
* return string | |
*/ | |
function mp_dumpVar($var, $label = '', $formatted = true) { | |
$dump = ($label !== '') ? $label . ":\n" : ''; |
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
/** | |
* Removes unwanted characters like < > " from passed path value | |
* | |
* @param string $value The value to clean | |
* @param string $replaceWith The replacement (empty by default) | |
* @return string Cleaned path value | |
*/ | |
function mp_getCleanPathVar($value, $replaceWith = '') | |
{ | |
$value = (string) trim($value); |
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
/** | |
* Checks, if passed string is utf-8 encoded or not. | |
* | |
* @param string $string String to check | |
* @return int Number of found UTF-8 character | |
*/ | |
function mp_detectUTF8($string) | |
{ | |
return preg_match('%(?: | |
[\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>How to center a div vertically and horizontally</title> | |
<style type="text/css"> | |
#centerBox { | |
position: absolute; | |
width: 600px; |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>Example Cross-Browser tooltip with CSS</title> | |
<style type="text/css"><!-- | |
body { | |
padding-top:130px; | |
} | |
#box { |
OlderNewer