Download presentation
Presentation is loading. Please wait.
Published byShanon Patrick Modified over 9 years ago
1
PHP Stringjet / Strukturat mbi Stringjet / Operatoret / Kushtet / Loops
2
Printimi Ka dy menyra per te shfaqur permbajtjen ne PHP te cilat jane: 1. echo 2. print echo “Ky eshte shembull”; print “Ky eshte shembull”;
3
Funksionet mbi stringjet echo str_word_count("Hello world!"); // output 2 echo strlen("Hello world!"); // output 12 echo strrev("Hello world!"); // output !dlrow olleH echo strpos("Hello world!", "world"); // output 6 echo str_replace("world", "Dolly", "Hello world!"); // output Hello Dolly! echo strtolower("Hello world!"); // output hello world! echo strtoupper("Hello world!"); // output HELLO WORLD! echo substr_replace("Hello","world",0); //output world
4
Operatoret Matematik ne PHP OperatoriEmriShembull +Addition$x + $y -Subtraction$x - $y *Multiplication$x * $y /Division$x / $y %Modulus$x % $y **Exponentiation$x ** $y Operatoret e Vleredhenies VleredheniaNgjashem me… x = y x += yx = x + y x -= yx = x - y x *= yx = x * y x /= yx = x / y x %= yx = x % y
5
Operatoret Krahasues OperatoriEmrertimiShembull ==Equal$x == $y ===Identical$x === $y !=Not equal$x != $y <>Not equal$x <> $y !==Not identical$x !== $y >Greater than$x > $y <Less than$x < $y >=Greater than or equal to$x >= $y <=Less than or equal to$x <= $y OperatoriEmrertimi ++$xPre-increment $x++Post-increment --$xPre-decrement $x--Post-decrement
6
Operatoret Logjike OperatoriEmertimiShembull andAnd$x and $y orOr$x or $y xorXor$x xor $y &&And$x && $y ||Or$x || $y !Not!$x
7
Fjalite Kushtore if if...else if...elseif....else if (kushti) { kodi nqs eshte kushti me lart true; } elseif (kushti) { kodi nqs eshte kushti me lart true; } else { kodi nqs kushtet me lart jane false; }
8
Switch switch (n) { case label1: code to be executed if n=label1; break; case label2: code to be executed if n=label2; break; case label3: code to be executed if n=label3; break;... default: code to be executed if n is different from all labels; }
9
PHP Loops While while (condition is true) { code to be executed; } Do While do { code to be executed; } while (condition is true); PHP for Loop for (init counter; test counter; increment counter) { code to be executed; }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.