Recent Notes

Displaying keyword search results 1 - 3
Created by jinx on April 25, 2011 12:43:40    Last update: April 25, 2011 12:43:40
Use the PHP function method_exists to check if the class or object has a certain method. It returns TRUE if the method exists (even when the value of the property is NULL), FALSE if the method does not exist. Example: <?php class A { var $p = 'A property'; ... Outputs: Class A has method f1: bool(true) Object $a has... Also note that C++-like method overloading does not exist in PHP. Thus there's no ambiguity about which version of the method exists, i.e., with no argument, with one argument... etc. The following code generates Fatal error: <?php class A { var $p = 'A property'; ...
Created by jinx on April 20, 2011 09:28:01    Last update: April 20, 2011 09:28:46
This code fragment shows how to find the previous Sunday using PHP date/time functions. <?php $current_time = time(); $last_sunday =... Sample output: Current time: 1303316297 Last Sunday same time:...
Created by Dr. Xi on April 22, 2007 21:58:45    Last update: January 19, 2009 20:26:12
Your code will be syntax highlighted when you specify the language of your code with the BBcode code tag: [code=lang] Your code here [/code] where "lang" is the language of your code. For example, the following Perl code #!/usr/bin/perl print "Hello World!\n"; is rendered with: [code=perl] #!/usr/bin/perl print "Hel... The following are supported languages and their corresponding names for BBcode: Apache conf: apacheconf, aconf, apache Bash... The full list is available from , which is our backend engine for syntax highlight rendering.