= PHP = http://www.php.net/ = syslog = Generate a system log message {{{#!highlight php }}} === Log levels and files in operative systems === ||'''OS''' || '''File'''|| '''Logged levels'''|| ||Slack64 14|| /var/log/messages|| INFO|| ||Slack64 14|| /var/log/syslog|| WARNING ERR CRIT|| ||CentOS 6.4|| /var/log/messages|| INFO WARNING ERR CRIT|| ||Ubuntu 12.04 Precise|| /var/log/syslog|| DEBUG INFO WARNING ERR CRIT|| ||Debian 7.0 Wheezy|| /var/log/syslog ||DEBUG INFO WARNING ERR CRIT|| == array_push == Push one or more elements onto the end of array {{{#!highlight php }}} == count == Count all elements in an array, or something in an object {{{#!highlight php }}} = sprintf = Return a formatted string {{{#!highlight php }}} = str_replace = Replace all occurrences of the search string with the replacement string {{{#!highlight php $bodytag = str_replace("%body%", "black", ""); ?> }}} == Class == {{{#!highlight php var; } } class Foo { public static $my_static = 'foo'; public function staticValue() { return self::$my_static; } } class Bar extends Foo { public function fooStatic() { return parent::$my_static; } } class Foo { public static function aStaticMethod() { // ... } } class MyClass { const CONSTANT = 'constant value'; function showConstant() { echo self::CONSTANT . "\n"; } } class MyClass { public $public = 'Public'; protected $protected = 'Protected'; private $private = 'Private'; function printHello() { echo $this->public; echo $this->protected; echo $this->private; } } ?> }}}