1 && file_exists("index".$modulNr."_".($oppgNr-1).".php")){ $returnArr[] = "Oppgave ".($oppgNr-1).""; } $returnArr[] = "Tilbake til modulen"; if(file_exists("index".$modulNr."_".($oppgNr+1).".php")){ $returnArr[] = "Oppgave ".($oppgNr+1).""; } return implode(' - ', $returnArr); } function title(): string { global $modulNr, $oppgNr; return "Modul ".$modulNr." - Oppgave $oppgNr"; } function higher($int1, $int2): int { if($int1 >= $int2){ return $int1; } return $int2; } function lower($int1, $int2): int { if($int1 < $int2){ return $int1; } return $int2; } function str_lreplace($search, $replace, $subject){ $pos = strrpos($subject, $search); if($pos !== false){ $subject = substr_replace($subject, $replace, $pos, strlen($search)); } return $subject; }