Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: ken-interak-guru/interak_php_basics
base: 0429aae45d
...
head fork: ken-interak-guru/interak_php_basics
compare: be401324ae
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
BIN  preparation/basics/14_functions/functions.esproj/user.interaksjon.espressostorage
Binary file not shown
View
BIN  preparation/oppgaver/okt_3/okt_3.esproj/user.interaksjon.espressostorage
Binary file not shown
View
55 preparation/oppgaver/okt_4/index.php
@@ -0,0 +1,55 @@
+<?php
+
+ echo '<h1>oppg 1</h1>';
+ function writeHello() {
+ echo "Heisann alle sammen";
+ }
+
+ writeHello();
+
+ echo '<br />';
+
+ echo '<h1>oppg 2</h1>';
+ function printNames($name1, $name2) {
+ echo $name1 . '<br />' . $name2;
+ }
+
+ printNames("Ken", "Johan");
+
+ echo '<br />';
+
+ echo '<h1>oppg 3</h1>';
+ function multiply($num1, $num2) {
+ $result = $num1 * $num2;
+ return $result;
+ }
+
+ echo multiply(5, 6);
+
+ echo '<br />';
+
+ echo '<h1>oppg 4</h1>';
+ function quadMultiply($num1, $num2, $num3, $num4) {
+ $result = multiply(
+ multiply($num1, $num2),
+ multiply($num3, $num4)
+ );
+ return $result;
+ }
+
+ echo quadMultiply(5, 2, 6, 3);
+
+ echo '<br />';
+
+ echo '<h1>oppg 5</h1>';
+ function tripleAdd($num1, $num2, $num3) {
+ if (gettype($num1) != 'integer' || gettype($num2) != 'integer' || gettype($num3) != 'integer') {
+ return 'Denne funksjonen tar kun i mot heltall';
+ }
+
+ return $num1 + $num2 + $num3;
+ }
+
+ echo tripleAdd(5, 4, 2);
+
+?>
View
BIN  preparation/oppgaver/okt_4/okt_4.esproj/Project.espressostorage
Binary file not shown
View
BIN  preparation/oppgaver/okt_4/okt_4.esproj/user.interaksjon.espressostorage
Binary file not shown

No commit comments for this range

Something went wrong with that request. Please try again.