Skip to content

Commit 0626e67

Browse files
committed
new lessons
1 parent 066c681 commit 0626e67

File tree

8 files changed

+120
-0
lines changed

8 files changed

+120
-0
lines changed

LESSON 59 - الدرس/app.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
if(isset($_COOKIE['name'])){
3+
echo $_COOKIE['name'];
4+
}
5+
?>

LESSON 59 - الدرس/index.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
// setcookie(name, value, expire);
4+
// $_COOKIE["name"]
5+
6+
setcookie("name","Coder Shiyar");
7+
8+
// setcookie("name","",time() - 3600);
9+
// setcookie("password",12,time() + 86400 * 30);
10+
11+
?>

LESSON 60 - الدرس/index.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
// طريقة إنشاء كلاس
3+
class App{
4+
5+
// طريقة إنشاء كونستروكتور كلاس
6+
function __construct()
7+
{
8+
echo 'Hi from Class App';
9+
}
10+
11+
}
12+
// طريقة إنشاء اوبجكت كلاس
13+
14+
$app = new App();
15+
$app2 = new App();
16+
17+
?>

LESSON 61 - الدرس/index.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
// طريقة إنشاء كلاس
3+
class App{
4+
protected $country = 'Kurdistan';
5+
public $age = '20';
6+
private $name = "Coder Shiyar";
7+
// طريقة إنشاء كونستروكتور كلاس
8+
function __construct()
9+
{
10+
echo $this->name;
11+
// echo 'Hi from Class App';
12+
}
13+
14+
}
15+
// طريقة إنشاء اوبجكت كلاس
16+
17+
$app = new App();
18+
// echo $app->age;
19+
// // echo $app->country;
20+
// echo $app->name;
21+
22+
?>

LESSON 62 - الدرس/index.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
// طريقة إنشاء كلاس
3+
class App{
4+
5+
// طريقة إنشاء كونستروكتور كلاس
6+
function __construct($img , $title)
7+
{
8+
echo $img;
9+
echo $title;
10+
}
11+
12+
}
13+
// طريقة إنشاء اوبجكت كلاس
14+
15+
$app = new App('<img src="https://codershiyar.com/img/logo.jpg" width="200" />',
16+
" <h1>Coder Shiyar</h1>");
17+
18+
19+
?>

LESSON 63 - الدرس/index.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
// طريقة إنشاء كلاس
3+
class App{
4+
5+
// طريقة إنشاء كونستروكتور كلاس
6+
function __construct()
7+
{
8+
// $this->printMessage();
9+
}
10+
11+
function printMessage($title){
12+
echo $title ;
13+
}
14+
}
15+
// طريقة إنشاء اوبجكت كلاس
16+
$app = new App();
17+
$app->printMessage('<h1>Coder Shiyar</h1>');
18+
19+
?>

LESSON 64 - الدرس/app.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php require_once 'index.php' ;
2+
$app = new App();
3+
echo $app->appName . '<br>';
4+
echo $app->appVersion . '<br>';
5+
echo $app->getTime();
6+
$app->printAppName();
7+
8+
?>

LESSON 64 - الدرس/index.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
class App{
3+
4+
public $appName = "Coder Shiyar";
5+
public $appVersion = 1.0;
6+
7+
function __construct()
8+
{
9+
10+
}
11+
12+
function getTime(){
13+
return date("H:i");
14+
}
15+
function printAppName(){
16+
echo '<h1>'. $this->appName.'</h1>';
17+
}
18+
}
19+
?>

0 commit comments

Comments
 (0)