 3  ,           ,        ,   , ,    .             .       ,    Java,        .          ,   ,            .        ,   .              .     ,   ,       .         ,   .       ,    2. ,               ,      .  :   $++; // $ -   $sum = $val1 + $val2; // $sum. $val1  $val2 -           ,     .     ,    ,          ,   ,         .            (.     ).  . 3.1     ,    . ,        ,   .    3.1.   	 	 	 ( )	-	 	 new	-	  	 ! ~		   ,   ++ --		, 	 @		 	 / * %		, , 	 + - .		, , 	 << >>		 ,   ()	 < <= > >=	-	,   , ,   	 == != === <>	-	,  , ,  	 & ^ |		  AND, XOR  OR	 && ||		  AND  OR	 ?:		 	 = += *= /= .=		 	 %= &= |= ^=	 	 	 <<= >>=	 	 	 AND XOR OR		  AND, XOR  OR	              :   $ = 5; //    5  $  $ = "5": //    "5"  $  $sum = 50 + $some_int; //   50 + $some_int  $sum  Swine = "Zinfandel"; //   "Zinfandel"  $wine  $inventory++: //   $inventory  1     ,         . :   $total_cost = $cqst + (Scost * 0.06): //    6-         ,       .       ,      . :   $total_cost = $cost + $cost * 0.06;     :   $total cost = $cost + ($cost * 0.06);    ,            .               (. . 3.1).      :   ,   .     ,   ,   . ,   $value = 3*4*5*7*2;    :   $value = ((((3 * 4) * 5) * 7) * 2);     840.   ,    (*)   .          . ,    $ = 5;  $value = $ - $b - $;      $c = 5;  $value = ($ - ($b - $));       $value, $a, $b  $    5.   ,    (=)   .        (. 3.2)             .  ,     .    3.2.          $ + $b     $  $b  $-$b     $  $b  $*$b     $  $b  $/$b       $  $b  $ % $b       $  $b               ,  ,    . .        .           .        ,    (   )     .      . 3.3.    3.3.   	  	 	 $ = 5; 	  	 $  5 	 $ += 5; 	    	  $   $  5 	 $ *= 5; 	   	 $   $  5 	 $/=5; 	   	 $    $  5 	 $ .= 5; 	    	 $   $  5 	           .          (. 3.4)     (  ) .    :   (.)      (.=),      .            .   3.4.         $a = "abc"."def"	    $    $  $b	 
 $ - "ghijkl" 
      $         "ghijkl"     :   // $    "Spaghetti & Meatballs" $ = "Spaghetti" . "& Meatballs"  // $    "Spaghetti & Meatballs are delicious" $a .= "are delicious";  ,           .          8.            (++)   (--),   . 3.5,                 1.    3.5.     			 ++$, $++		 $   1	 --$, $--		 $   1	   :      ,     . ,  ,   ,       .   :   $inventory = 15; //  Sinventory   15  $old_inv = Sinventory--; //   $old_inv   // Sinventory.    Sinventory.  $orig_iinventory = ++inventory;//   Sinventory.    //    Sinventory  //  $orig_inventory.   ,           .        (. 3.6)           ,          .                (,    i f,    for  while).    3.6.             $ && $b     ,     ,   $aAND$b      ,       $  $b     ,          $ OR $b      ,          !$      ,   $    NOT !$a      ,   $    $ XOR $b     ,                 :   file_exists("filename.txt") OR print "File does not exist!";      :   filename.txt ;    : File does not exist!.        (. 3.7)         .    3.7.            $a==$b 	  	,  $  $b  	 $ != $b 	  	,  $  $b   	  $ === $b      ,  $  $b                      ,      (, $ = $b). ,     $b  $,      .        (. 3.8),    ,             .    3.8.             $a<$b      ,   $  $b  $a>$b      ,   $  $b  $a <= $b        ,   $    $b  $a >= $b        ,   $    $b  ($a-12)?5: -1         $  12,   5,       1    :         .        , ,  ,  .         .       8.                ,  .      ,           .  . 3.9         .    3.9.         	  	 2	10	 5	101	 10	1010	 12	1100	 145	10010001	 1 452 012	1011000100111111101100	   ,   . 3.10,      ,       .    3.10.          $&$b       ,     $  $b,     $|$       ,     $  $b,      $^$b  
       ,     $  $b,       ~$b         $b    $ << $b        $   $b,        $ >> $b        $   $b,                  ,          (Randall Hyde) The Art of Assembly Language Programming,    http://webster.cs.ucr.edu/Page_asm/Page_asm.html.    ,   -   Web.                ,             .  ,     .              ,           .   $ == $b.   ,  $  $b,     .      1,      0.   :   $ = 5;  $b = 5;  print $ == $b;      1.   $  $    ,   5,  0.   if   if     ,         ,       ,  (  )   .      i f:   if () {    }    if () {    }  else {    }      ,     ,   .      ,       ,     .             :   if ($cooking_weight < 200) {  print "This is enough pasta (< 200g) for 1-2 people";  }  else {  print "That's a lot of pasta. Having a party perhaps?";  }          ,    :   if ($cooking_weight < 100) print "Are you sure this is enough?";  elseif   elseif     if       ,     :   if () {    }  elseif () {    }        elself       else if.      ,       .  elself     ,      .  :  elself     ,     if  elself  .  if ($cooking_weight < 200) {  print "This is enough pasta (< 200g) for 1-2 people";  }  elseif ($cooking_weight < 500) {  print "That's a lot of pasta. Having a party perhaps?"; }  }  else {  print "Whoa! Who are you cooking for, a football team?";  }    if    i f      .    ,     . ,        ,      ( ):   //   $pasta  if ($food == "pasta") {  //   $cooking_weight  if ($cooking_weight < 200) {  print "This is enough pasta (< 200g) for 1-2 people";  }  elseif ($cooking_weight < 500) {  print "That's a lot of pasta. Having a party perhaps?";  }  else {  print "Whoa! Who are you cooking for. a football team?";  }   }      ,   if      . ,       ,  ,          .                    :   if ($cooking_weight < 0) { 
 print "Invalid cooking weight!";  }   if ( ($cooking_weight > 0) && ($cooking_weight < 200) ) { 
 print "This is enough pasta (< 200g) for 1-2 people";  }  elseif ( ($cooking_weight > 200) && ($cooking_weight < 500) ) { 
 print "That's a lot of pasta. Having a party perhaps?";  }  else { 
 print "Whoa! Who are you cooking for, a football team?";  }        ,              ,       .            ,   .   ({ })   .          :   if () :      else :      endif;   ,     if  :   if ($== $b) {  print "Equivalent values!";  }  if ($a == $b) :  print "Equivalent values!";  endif;  while   while    ()   .   while    ,     .    while  :   while () :    endwhile;     while     (n!),  n = 5:   $n = 5;  $n = $n;  $factorial = 1; //      while ($n > 0) :  $factorial - $n * $factorial;  $n--; //  $n  1   endwhile;  print "The factorial of $ncopy is $factorial.";     :   The factorial of 5 is 120.     $n     .         ,   $n   0,   $factorial   0  ,    .                $n > 1,   $factorial  1       .       ,            .  do. .while   do. .while    ,    while,    ,   do. .while     ,     . ,   do. .while      ,   while    ,        :   do:    while ();              do. .while:   $n = 5:   $ncopy = $n;   $factorial = 1; //      do {  $factorial = $n * $factorial;  $n--: //  Sn  1  } while (Sn > 0);  print "The factorial of Sncopy is $factorial.";          ,         .     do. .while     (    :    ),        .   for   for       .     while  ,         ,   -   .       while,     ,     .    for  :   for (: ; ) {    }      for      .            .        ,       . ,        . ,      ,     ,        .        for:  for ($i = 10; $1 <- 100: $1 +=10) : //      print "\$i = $i <br>"; endfor; //    $1       :   $i = 10  $i = 20  $i = 30  $i = 40  $i - 50  $i = 60  $i = 70  $i = 80  $i = 90  $i = 100       $i   10.    ,      ,  $i        100. ,     $i   10.    print  10 ,      $i.  :   $i  10     .     ,   for        $i = $i + 10.   ,        ,     :   for ($i = 10; $i <= 100; print "\$i - $i <br>". $i+=10);     ,        ,     -  .      ?   ,    for    .   ,      ,    :   for ($x=0,$y=0: $x+$y<10; $x++) :  $ += 2; //  $  2   print "\$y = $y <BR>"; //   $  $sum = $x + $y;  print "\surn = $sum<BR>"; //   $sum  endfor;  :  $y = 2   $sum = 2   Sy = 4   $sum = 5   $y = 6   $sum = 8   $y = 8   $sum = 11       $y   $  $.     ,   $sum = 11,         ($ + $ < 10).   - ,        $   6,   $   2.     ,  $  $    ,       .      11    10   .      for    . ,         ,      .      ,          ,   .          . :  $ = 5:  for (: : $ +=2) :  print " $ ";  if ($x == 15) :  break; //    for  endif;  endfor;    :   5 7 9 11 13 15     for  while    , ,   for    .   ,      for          .   ,   while                  .   foreach   foreach    for,        .     foreach,     :   foreach ( as $) {    }  foreach ( as $ => $) {    }  ,    :  $menu = rr("pasta", "steak", "potatoes", "fish", "fries");  foreach ($menu as $item) {  print "$item <BR>";  }     :   pasta  steak  potatoes  fish  fries          . -,  foreach      (      ). -,                     foreach.          :   $wine_inventory = array {  "merlot" => 15,  "zinfandel" => 17,  "sauvignon" => 32  }  foreach ($wine_inventory as $i => $item_count) {  print "$item_count bottles of $i remaining<BR>";  }        :   15 bottles of merlot remaining  17 bottles of zinfandel remaining  32 bottles of sauvignon remaining      ,  foreach     .         5.   switch     switch   if  ,    ,     .        ,   switch      .    switch:  switch () {  case ():    case ():    ...  default:    }           switch.          case.       .     ,     default.       ,         . ,              ,     case.        switch:  $user_input = "recipes"; // ,   switch ($user_input) :  case("search") :  print "Let's perform a search!";  break;  case("dictionary") :  print "What word would you like to look up?";  break;  case("recipes") :  print "Here is a list of recipes...";  break;  default :  print "Here is the menu...";  break;  endswitch;      ,  switch      . ,    switch (    $user_input),       case.  ,    case,     ,    .  break     case     switch.        ,    default.   default        ,  switch         .     ,      case  break (.  )  switch       ,       break       switch.        break: $value = 0.4;  switch($value) :  case (0.4) :  print "value is 0.4<br>";  case (0.6) :  print "value is 0.6<br>";  break;  case (0.3) :  print "value is 0.3<br>";  break;  default :  print "You didn't choose a value!";  break;  endswitch;    :   value is 0.4  value is 0.6    break   ,       print   ,    ,    print   .     switch  -  switch,     print.      switch  if      -.            .  break   break      while, for  switch,    .       ,         break.     break  :   break n;    n     ,   break. ,   break     while   break   2,      .    n  1;          1,     break  .  :  i f      ,   break.         .       break   foreach:   $arr = array(14, 12, 128, 34, 5);  $magic number = 128:  foreach ($arr as $val) :  if (Sval == $magic_number) :  print "The magic number is in the array!";  break;  endif;  print "val is Sval <br>";  endforeach;    $magic_number    $rr (   ),  .   :   val is 14  val is 12  The magic number is in the array!         break.      in_array( ),        ;       5.   continue          continue.    continue             .   continue   :   continue n;    n ,        continue.       continue. ,         0    .   ,      is_prime(),  ,     :   $boundary = 558;  for ($i = 0; $i <= $boundary: $i++) :  if (! is_prime($i)) :  continue;  endif;  $prime_counter++;  endfor;      ,   if    $prime_counter .      continue,          .    continue         -    .     continue  .   continue      ,         if.   :        ,  ,      -.        ,        ,       .      ,    ,      ,      .              :   July 21, 2000|8 p. m.|Cooking With Rasmus|PHP creator Rasmus Lerdorf discusses the wonders of cheese.  July 23, 2000|11 a. m.|Boxed Lunch|Valerie researches the latest ham sandwich making techniques (documentary)  July 31, 2000|2:30p.m.|Progressive Gourmet|Forget the Chardonnay: iced tea is the sophisticated gourmet's beverage of choice.  August 1, 2000|7 p.m.|Coder's Critique|Famed Food Critic Brian rates NYC's hottest new Internet cafes.  August 3, 2000|6 p.m.|Australian Algorithms|Matt studies the alligator's diet.   . 3.1     ,    3.1.     . .1.           ,      :   ,    .      4 : , ,     .     .   .    3.1.     events.txt     <?  // :   // :       //         //    Sevents   events.txt  $events - fopen ("events.txt". "r");  print "<table border = 0 width = 250>"  print""<tr><td valign=top";  print "<h3>Events Calendar:</h3>";  // ,        while (! feof(Sevents)) :  //      events.txt $event = fgets($events. 4096);  //         $event_info = explode("|". Jevent);  //        print "$event_info[0] ( $event_info[1] ) <br>";  print "<b>$event_info[2]</b> <br>";  print "$event_info[3] <br> <br>";  endwhile;  //    print "</td></tr></table>";  fclose ($events);   ?>       ,               .  -     ,                .          ,    7  /      8            .                 , , ,          .       ,  :  ;  ;   ;   ;    (If, while, do. .while, for, foreach, switch, break, continue).              .        ;          , - ,  /    .         ,      ,     . ,       !