[Solved] unexpected ‘(‘, expecting ‘&’ or variable (T_VARIABLE) [closed]


You need to define a variable, then you can pass the result of a function

function ongoing_cases_control($isAdmin)
{
    if ($isAdmin) { // Note "== 1" will be true for any value that evaluates to true, so might as well just check for any value that evaluates to true.
        // Return the result so you don't have side effects
        return '
        <div class="col-md-3">
                  <div class="panel panel-primary">
                       <div class="panel-heading">Ongoing Cases Panel</div>
                          <div class="panel-body">  
                            <p>You can edit, add on ongoing cases</p>
                      </div>
                  </div>
              </div>

      ';
    }
}

Usage:

echo ongoing_cases_control(isAdmin());

solved unexpected ‘(‘, expecting ‘&’ or variable (T_VARIABLE) [closed]