2026-07-23
Page Title: Misc - Programming Php
Last Modified: 2026-07-01 06:52:23
Current Date: 2026-07-23 13:54:34 UTC
PHP is a server-side scripting language designed for building dynamic web applications and generating HTML.
It process requests on the server, access databases, handle forms, manage sessions, and output HTML/CSS/JS to clients.
These are my Programming Forgets.
Due to the medication I take I do struggle at times to remember or differentiate between programming languages formats and their language comprehensions so I just place these simple steps here as code examples to help me remember.
If you copy any of these examples remember a PHP script needs to start with <?php and end with a ?> when running the script on the server.
Due to the medication I take I do struggle at times to remember or differentiate between programming languages formats and their language comprehensions so I just place these simple steps here as code examples to help me remember.
$a = 200;
$b = 33;
if ($b > $a) {
echo "b is greater than a";
} elseif ($a == $b) {
echo "a and b are equal";
} else {
echo "a is greater than b";
}
for ($x = 0; $x < 6; $x++) {
echo $x . PHP_EOL;
}
for ($x = 0; $x < 6; $x++) {
echo $x . PHP_EOL;
if ($x == 3) {
break;
}
}
for ($x = 0; $x < 6; $x++) {
echo $x . PHP_EOL;
if ($x == 3) {
echo "Hello, x is $x" . PHP_EOL;
continue;
}
}
$x = 0;
while ($x < 6) {
echo $x . PHP_EOL;
$x += 1;
}
$x = 0;
while ($x < 6) {
echo $x . PHP_EOL;
if ($x == 3) {
break;
}
$x += 1;
}
$x = 0;
while ($x < 6) {
$x += 1;
echo $x . PHP_EOL;
if ($x == 3) {
echo "Hello, x is $x" . PHP_EOL;
continue;
}
}
Copyright © 2002 to 2026