fork download
  1. <?php
  2. $gradeCell = 'EPR 5+'; //get the cell value
  3. $gradeValue = filter_var($gradeCell, FILTER_SANITIZE_NUMBER_INT); //grade numerical value (the number from cell)
  4. //See if it has +, add a 0,5 then
  5. $hasPlus = strpos($gradeCell, '+');
  6. if ($hasPlus !== FALSE) {
  7. $gradeValue = $gradeValue[0] + 0.5;
  8. }
  9. echo $gradeValue;
  10.  
  11. ?>
Success #stdin #stdout 0.01s 20520KB
stdin
Standard input is empty
stdout
5.5