Php example maked

This commit is contained in:
John Doe 2025-06-04 13:38:09 +00:00
parent 5693aa4609
commit 3580630871

View File

@ -1,3 +1,24 @@
<?php <?php
echo 'Merhaba, Dünya!'; // Class definition that creates an instance of a class
class ExampleClass {
public $exampleVariable; // a variable belonging to the class instance
// Constructor function, called when an object is created
public function __construct($value) {
$this->exampleVariable = $value; // assigns value to the instance variable
}
// Function that adds two numbers
public function add($number1, $number2) {
return $number1 + $number2; // returns the sum
}
}
// Example function: multiplies two numbers
function multiply($number1, $number2) {
return $number1 * $number2; // returns the product
}
// Array example
$sampleArray = [1, 2, 3, 4, 5]; // array of numbers
?> ?>