Articles Tagged 'Function'

Very short snippet: PHP isset_post ()

Often having to check if a variable has been sent with the POST, and if not, assign a default value. Instead of using the syntax:

1
isset ( $_POST [ 'var_post' ] ) ? $_POST [ 'var_post' ] : default ; $ Miavar = isset ($ _POST ['var_post'])? $ _POST ['var_post']: default;

Continued ...

WordPress: customize the navigation between the posts

WordPress offers many features to navigate through the various posts and pages forward and back. These are used within the themes, often in a completely interchangeable, although they contain some differences. This, in fact, create much confusion in the choice of the function to use. Here are some notes:

Continued ...

WordPress: wp_parse_args ()

The function wp_parse_args() (like many other undocumented) issue a string in the format:

1
var1 = value1 & var2 = value2 ... Varn = valueN

Continued ...

Variable arguments and default in Javascript, Actionscript and PHP

Who develops knows that one of the characteristics of functions ( function () ) is to have or not the input arguments. It can happen, sometimes you have to write a function that, based on input parameters, behaves differently (in OO programming this behavior are referred to as polymorphism). Variable parameters (varargs), already introduced at the time of the present by default in C and classical statement of the main :

1
int main (int argc, char * argv []);

Continued ...


Stop SOPA