Skip to main content

Overview

Intro

PHP Informatieen HTML

<?

PHP phpinfo();

Comments

Data types

FormVariabelen

<form

Math

method='POST'>

Arrays

<h2>Please

Associative inputArrays

your

Control name:</h2>Structures

<input

it type="text"- name="name">then <input-else

type="submit"

comparison value="Submitand Name">logic </form>operators

<?php

switch

$name

while

=

for

$_POST['name'];

foreach

echo

Functions

"<h3>

functions

Hello

parameters

$name

return </h3>";values

?>

Scope (Global v Local)

Constants

Build in functions

math

string

array

date

Forms

Database PDO

PHP Web

post and get super global

$_SERVER special variables_server

<?
echo "Your User Agent is :" . $_SERVER ['HTTP_USER_AGENT'];

Cookies

isset() met $_SERVER variableSessions

<?php
if (!empty($_SERVER['HTTPS'])) 
{
  echo 'https is enabled';
}

Tabel HTML met variabelen

<?php
$a=1000;
$b=1200;
// TODO: zet hier een variable $c en geeft die een waarde 1400
echo "<table border=1 cellspacing=0 cellpading=0>
<tr> <td><font color=blue>Salary of Mr. A is</td> <td>$a$</font></td></tr> 
<tr> <td><font color=blue>Salary of Mr. B is</td> <td>$b$</font></td></tr>
// TODO: maak hier de derde regel in de tabel met de kolom Mr."C" en waarde van $c
</table>";
?>

OOP