Academic Tutorials



English | French | Portugese | Dutch | Italian
Google

in linea

Domestico Codici sorgente E-Libri Trasferimenti dal sistema centrale verso i satelliti Metterseli in contatto con Circa noi

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
AJAX Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PHP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
.NET (dotnet)
Microsoft.Net
XML Web Services
ASP.Net
.Net Mobile
C# : C Sharp
ADO.NET
VB.NET
Multimedia
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills


Operatori in PHP

Previous Next





L'operatore è un simbolo o può essere una serie di simboli, che una volta usate con alcuni valori realizzano una certa azione e producono un nuovo valore.


Operatore di assegnazione

L'operatore di assegnazione “=„ è la maggior parte del operatore ampiamente usato in PHP. Questo operatore è usato per inizializzare la variabile. Questo operatore è usato fra due operandi. Valuta l'operando e i assigs destri il relativo valore all'operando a mano sinistra. La maggior parte dei operatori sono usati per fornire un certo risultato senza cambiare il valore dei loro operandi. Ma l'operatore di assegnazione infrange questa regola.

print ($name = “John”); //assigns “John” to “$name”, then
outputs “$name”

Allo stesso tempo potete effettuare le cose multiple. Così potete assegnare non solo la parola “John„ “al $name„ variabile, ma potete anche produrre la variabile (quasi) allo stesso tempo.


Operatore del puntino

Usando l'operatore di concatenazione possiamo collegare i caratteri supplementari ad una stringa. Ciò è un singolo puntino “.„. Trattando entrambi gli operandi come i tipi della stringa, collega l'operando destro all'operando a mano sinistra, il risultato è ofcourse, una stringa.

$first_name = “John”;
$last_name = “Davis”;
print $first_name . $last_name; //outputs “John Davis”


Operatori aritmetici

Gli operatori aritmetici inoltre sono usati in molti linguaggi di programmazione. Li conoscete per sicuro che cosa ciascuno di loro fare, in modo da attaccherà appena per indicarla fuori: aggiunta “+„, sottrazione “-„, “/„ di divisione, moltiplicazione “*„ e modulo “%„.

<?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?>

Operatori di confronto

Già avete visto alcuni degli operatori della stringa e di aritmetica in PHP. Tuttavia, la lingua inoltre viene con gli operatori che sono destinati specificamente per confrontare due valori: Questi operatori sono chiamati “operatori di confronto„. Qui è un esempio dimostra gli operatori di confronto nell'azione:

<?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?>




Previous Next

Keywords:php tutorial, php scripts, php nuke, php download, php editor, php mysql, php forum, php add link, learn php, php code


HTML Quizes
HTML Quiz
XHTML Quiz
CSS Quiz
TCP/IP Quiz
XML Quizes
XML Quiz
XSL Quiz
XSLT Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XSL-FO Quiz
XML DOM Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
SOAP Quiz
WSDL Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizes
JavaScript Quiz
VBScript Quiz
AJAX Quiz
DHTML Quiz
HTML DOM Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizes
ASP Quiz
PHP Quiz
PERL Quiz
SQL Quiz
ADO Quiz
.NET (dotnet) Quizes
Microsoft.Net Quiz
XML Web Services Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
ADO.NET Quiz
VB.NET Quiz
Multimedia Quizes
SVG Quiz
Flash Quiz
Media Quiz
SMIL Quiz
Web Building  Quizes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Java Quizes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Programming Langauges Quizes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Soft Skills Quizes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz

Privacy Policy
Copyright © 2003-2008 Vyom Technosoft Pvt. Ltd., All Rights Reserved.