Php: Difference between revisions
Jump to navigation
Jump to search
Adamcolton (talk | contribs) No edit summary |
Adamcolton (talk | contribs) No edit summary |
||
| Line 5: | Line 5: | ||
== Error Log == | == Error Log == | ||
cat /var/log/apache2/error.log | cat /var/log/apache2/error.log | ||
== Dates == | |||
date('Y-m-d H:i:s') //mysql datetime | |||
date('Y-m-d') //mysql date | |||
== Arrays == | == Arrays == | ||
Revision as of 17:15, 18 February 2016
Misc.
- count($arr) : returns array length
- join($glue, $arr)
Error Log
cat /var/log/apache2/error.log
Dates
date('Y-m-d H:i:s') //mysql datetime
date('Y-m-d') //mysql date
Arrays
array_key_exists(key,array);
JSON
json_decode($str, true); json_encode($obj);
The true makes it associative.
Files
readfile($filename);
Ouputs the file to stdOut.
file_put_contents($filename, $str);
Write string to file.