View Full Version : Shorthand Coding?

11-17-2011, 03:40 PM
$this->current_page = 1;
$this->items_per_page = (!empty($_GET['ipp'])) ? $_GET['ipp']:$this->default_ipp;


Does anyone know a name for this style of shorthand code. E.g. the use of the arrows -> and the shorthand IF.

Also does anyone know of any good references or tutorials for using this shorthand.

11-17-2011, 03:45 PM
The shorthand IF is called a ternary operator. The "->" that you see is not what one would call a shorthand. It's a reference to the attributes of the class that the variables/methods are in.

11-17-2011, 04:05 PM
It's PHP OOP. You can learn it here.


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum