User Tools

Site Tools


kurs:php9.8

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

kurs:php9.8 [2014/09/10 21:22] (current)
Line 1: Line 1:
 +====== Werteübergabe als Referenz ======
 +<code php>
 +<?php
 +function runterzählen(&​$start){ //Adresse wird als Argument übergeben
 + while($start > 0){
 + print("​$start ...<​br>"​);​
 + $start--; //Wert der Adresse wird geändert
 + }
 + print("​Booommmmm!<​br>"​);​
 +}
 +$zahl = 5;
 +runterzählen($zahl);​ //damit wird auch der Wert übergeben
 +print('​Inhalt von $zahl = '​.$zahl);​
 +?>
 +</​code>​
  
 +**Ausgabe**\\
 +5 ...\\
 +4 ...\\
 +3 ...\\
 +2 ...\\
 +1 ...\\
 +Booommmmm!\\
 +Inhalt von $zahl = 0
kurs/php9.8.txt · Last modified: 2014/09/10 21:22 (external edit)