Learn PHP β dynamic websites and server-side magic! β‘
PHP is a server-side scripting language widely used for building dynamic websites and web applications.
βPHP makes websites dynamic and interactive.β
Variables, strings, and printing output:
<?php
$name = "Dyl";
$age = 15;
echo "Name: $name\n";
echo "Age: $age\n";
?>
Reusable blocks of code:
<?php
function add($a, $b) {
return $a + $b;
}
echo "Sum: " . add(2,3);
?>
Repeating tasks with loops:
<?php
for($i=0; $i<5; $i++) {
echo "Loop $i\n";
}
?>
Type PHP code below. This is a **simulated runner**βonly prints lines with echo.
Output will appear here...
*Simulated output (real PHP requires a server)