File tree Expand file tree Collapse file tree 8 files changed +120
-0
lines changed Expand file tree Collapse file tree 8 files changed +120
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ if (isset ($ _COOKIE ['name ' ])){
3+ echo $ _COOKIE ['name ' ];
4+ }
5+ ?>
Original file line number Diff line number Diff line change 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+ ?>
Original file line number Diff line number Diff line change 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+ ?>
Original file line number Diff line number Diff line change 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+ ?>
Original file line number Diff line number Diff line change 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+ ?>
Original file line number Diff line number Diff line change 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+ ?>
Original file line number Diff line number Diff line change 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+ ?>
Original file line number Diff line number Diff line change 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+ ?>
You can’t perform that action at this time.
0 commit comments