Functions
WebDev/*nix assorted functions & hacks
Search
find all
Array
-
Bash
-
Classes
-
Config
-
DateTime
-
Debug
-
dotjs
-
File
-
foooo
-
Git
-
HTML
-
Images
-
Javascript
-
Linux
-
Math
-
Misc
-
MySQL
-
OS X
-
Reading
-
Redis
-
Shell scripts
-
snippets
-
SQL
-
Strings
-
TextMate
-
Web
-
\(^o^)/ Fun!
-
_Misc hacks
-
_Pages
Misc
* Readme
** Meta: todo
bash colors. thing.
getset($key, $val=null)
get_vars_from_file($file)
googlinks($links, $total, $return=0)
header_404()
return_bytes($val)
valid_email($address)
9
found
auth
Name:
Category: Misc
Body:
/* getset() stores values for you, that you can call from anywhere, in- and outside of functions and classes, without using global or overwriting existing variables (the only bit of namespace that's taken is 'getset' in the function list). getset('x', 123) sets x to 123, getset('x') will now return 123. getset('y') returns null as it hasn't been set yet. getset() returns all values. */ #__________________________ # getset($key, $val=null) / function getset($key, $val=null) { static $values = array(); if (! isset($key)) return $values; if (isset($val)) { $values[$key] = $val; return $val; }else{ if (isset($values[$key])) { return $values[$key]; }else{ return null; } } }
Footer