⇤ ← Revision 1 as of 2014-07-09 20:32:16
Size: 667
Comment:
|
Size: 666
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 4: | Line 4: |
= syslog = | = syslog = |
Line 7: | Line 7: |
<?php | |
Line 8: | Line 9: |
<?php |
PHP
syslog
Generate a system log message
Toggle line numbers
1 <?php
2 // levels LOG_EMERG LOG_ALERT LOG_CRIT LOG_ERR LOG_WARNING LOG_NOTICE LOG_INFO LOG_DEBUG
3 syslog(LOG_INFO,'Hello here'); // In Slackware by default logs the message to /var/log/messages
4 ?>
sprintf
Return a formatted string
Toggle line numbers
1 <?php
2 echo sprintf('There are %d monkeys in the %s', 5, 'tree');
3 ?>
str_replace
Replace all occurrences of the search string with the replacement string
Toggle line numbers
1 <?php
2 // Returns <body text='black'>
3 $bodytag = str_replace("%body%", "black", "<body text='%body%'>");
4 ?>