Philadelphia Reflections

The musings of a physician who has served the community for over six decades

Related Topics

Financial Planning for a Long Retirement

How should individual investors ensure they have enough money for retirement?

Such a person is often a professional or entrepreneur who has worked to accumulate the wealth. Legions of "advisors"line up to take this money and manage it or else to sell "products" that promise to solve some problem or other. Without this background, extra savings will be needed, to buy advice. And advice is not invariably reliable.

A person who has created his/her career and its wealth from scratch, can likely manage investments themselves, or at least supervise the process from a position of strength from observation. Reliable advice is not always cheap.

This collection of articles explains to the individual investor how to take control of their wealth. They may eventually decide to look for help from an advisor but they will retain control of their assets and they will know what to do.

Financial Planning videos on YouTube

Ternary Operator and the IIF function

The standard PHP If statement can be reduced by the ternary operator, which is described in the PHP manual Comparison Operators. The IIF function puts the ternary operator into a function.

Ternary Operator

conditional ? if_true : if_not_true;

is the same as

if (conditional)
  {
  if_true
  }
  else
    {
    if_not_true
    }

IIF Function

To return the result of the ternary operator

function iif($expression, $returntrue, $returnfalse = '') {
    return ($expression ? $returntrue : $returnfalse);
}

Originally published: Thursday, June 19, 2008; most-recently modified: Tuesday, April 30, 2019