HTML Tutorials |
|
XML Tutorials |
|
Browser Scripting |
|
Server Scripting |
|
.NET (dotnet) |
|
Multimedia |
|
Web Building |
|
Java Tutorials |
|
Programming Langauges |
|
Soft Skills |
|
Database Tutorials |
|
Operating System |
|
Software Testing |
|
SAP Module |
|
Networking Programming |
|
Microsoft Office |
|
Accounting |
|
|
Operator ist ein Symbol oder kann eine Reihe Symbole sein, die, wenn sie mit etwas Werten verwendet werden, etwas T�tigkeit durchf�hrt und einen neuen Wert produziert.
|
Assignment Operator
|
Assignment operator "=" is most widely used operator in PHP. This operator is used to initialize
the variable.This operator is used in between two operands. It evaluates right-hand
operand and assigs its value to the left-hand operand. Most operators are used to produce
some result without changing the value of their operands. But assignment operator breaks
this rule.
|
print ($name = �John�); //assigns �John� to �$name�, then
outputs �$name�
|
|
At the same time you can perform multiple things. So you can assign not only
the word �John� to the variable �$name�, but can also output the variable at (almost)
the same time..
|
Dot Operator
|
Using the concatenation operator we can append additional characters to a string.
This is a single dot �.�. Treating both operands as the string types, it appends
the right-hand operand to the left-hand operand, the result is ofcourse, a string.
|
$first_name = �John�;
$last_name = �Davis�;
print $first_name . $last_name; //outputs �John Davis�
|
|
Arithmetic Operators
|
Arithmetic operators are also used in many programming languages. You know for sure
what each of them do, so we�ll just stick to point them out: addition �+�,
subtraction �-�, division �/�, multiplication �*�, and modulus �%�.
|
<?php
/* define some variables */
$mean = 5;
$median
$mode = 9;
//post-increment operator
$mean++;
//$mean now equals 6
//pre-increment operator
++meanx;
//$mean is now 7
//post-decrement operator
$mean--;
//$mean is down to 6
//pre-decrement operator
--$mean;
//$mean is down to 5
//addition operator
$median = $mean + $mode;
//$median now equals 14
//substraction operator
$median = $mode - $mean;
//$median now equals 4
php?>
|
|
Vergleich Operators
|
Du hast bereits einige der Arithmetik- und Zeichenketteoperatoren in PHP gesehen. Jedoch kommt die Sprache auch mit Operatoren, die spezifisch entworfen sind, um zwei Werte zu vergleichen: Diese Operatoren werden �Vergleich Operatoren� angerufen. Ist hier ein Beispiel demonstriert Vergleich Operatoren in der T�tigkeit:
|
<?php
/* define some variables */
$mean = 9;
$median = 10;
$mode = 9;
// less-than operator
// returns true if left side is less than right
// returns true here
$result = ($mean < $median);
print "result is $result<br /> ";
// greater-than operator
// returns true if left side is greater than right
// returns false here
$result = ($mean > $median);
print "result is $result<br /> ";
// less-than-or-equal-to operator
// returns true if left side is less than or equal to right
// returns false here
$result = ($median <= $mode);
print "result is $result<br /> ";
// greater-than-or-equal-to operator
// returns true if left side is greater than or equal to right
// returns true here
$result = ($median > = $mode);
print "result is $result<br /> ";
// equality operator
// returns true if left side is equal to right
// returns true here
$result = ($mean == $mode);
print "result is $result<br /> ";
// not-equal-to operator
// returns true if left side is not equal to right
// returns false here
$result = ($mean != $mode);
print "result is $result<br /> ";
// inequality operator
// returns true if left side is not equal to right
// returns false here
$result = ($mean <> $mode);
print "result is $result";
php?>
|
|
 |
 |
Keywords:php tutorial, php scripts, php nuke, php download, php editor, php mysql, php forum,
php add link, learn php, php code
|
|
HTML Quizes |
|
XML Quizes |
|
Browser Scripting Quizes |
|
Server Scripting Quizes |
|
.NET (dotnet) Quizes |
|
Multimedia Quizes |
|
Web Building Quizes |
|
Java Quizes |
|
Programming Langauges Quizes |
|
Soft Skills Quizes |
|
Database Quizes |
|
Operating System Quizes |
|
Software Testing Quizes |
|
SAP Module Quizes |
|
Networking Programming Quizes |
|
Microsoft Office Quizes |
|
Accounting Quizes |
|
|