Grundlagen Flashcards

https://www.php-einfach.de/php-tutorial/

1
Q

PHP: Definition

A

serverseitige Scriptsprache –> Webserver benötigt

z.B.:XAMPP

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

PHP: XAMPP

A

Apache - MySQL - Perl - PHP
Starten über xampp_start.exe
Gespeichert im htdocs-Ordner
Abrufbar über http://localhost/ bzw. http://127.0.0.1/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

PHP: Info ob am Server PHP installiert

A

PHP Datei mit:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

PHP Datei

A

HTML und PHP ausführbar

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

PHP: Ausgabe

A

echo “”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

PHP: “ \

A

\ vor jedem “ und \ wenn als Text

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

PHP: Kommentare

A

// # /**/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

PHP: Variablen - Grundlegend

A

mit $ angezeigt

z.B.:$name= “Robin”;
echo “Ich heiße §name”;
echo “irgendwas” .$name. “irgendwas”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

PHP: Variablentypen

A

integer, string, float, bool

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

PHP: Rechnen

A

wie Java (pow, sqrt)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

PHP: GET

A

Beschränkt mit Textlänge (durch URL - Passworteingabe unpassend)
Varibalenwerte mittels URL übergeben (ab ? in URL)

get.php?vorname=Max -übergibt-> $name = $_GET[‘vorname’];

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

PHP: POST

A

Post-Variablen per Formular übertragen

Uneingeschränkte Textlänge

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

PHP: Vergleichsoperatoren

A
== Gleich
=== Identisch...
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

PHP: Logische Operatoren

A

AND, OR

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

PHP: For - Schleife

A

for(Startwert; Bedingung; Schleifenschritt) {
Anweisungen
}
z.B.: for($i=0; $i < 10; $i++)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

PHP: Grundaufbau

A
17
Q

PHP: “normale” Arrays definieren

A

$wochentage = array(“Sonntag”,”Montag”,”Dienstag”,
“Mittwoch”,”Donnerstag”,”Freitag”,”Samstag”);

echo $wochentage[1];

18
Q

PHP: Assoziative Arrays definieren!!!

A

Für große Arrays, um umständliche Indizes zu vermeiden
mit =>; auch mit Schlüssel veränderbar

$wochentage = array(
"so" => "Sonntag",
"mo" => "Montag",
"di" => "Dienstag",
"mi" => "Mittwoch",
"do" => "Donnerstag",
"fr" => "Freitag",
"sa" => "Samstag");

echo $wochentage[“mo”];