different)
$x!== $y
Returns true if $x are not equal to $y and they are of different types.
>
Greater than
$x > $y
Returns True if the $x is greater than $y.
Greater than
$x
Returns True if the $x is less than $y.
>=
Greater than or equal to
$x >= $y
Returns true if $x is greater than or equal to $y.
Less t
output and 1 is always returned.
Tip: echo is a little faster than print because it does not return any value.
";print "Study PHP at $txt2";print "My car is a {$cars[0]}";?>
5. string and integer
1) a string is a character sequence, such as "Hello world! ".
A string can be any text in quotation marks. You can use single or double quotation marks:
2) integer
PHP var_dump () returns the data type and value of the variable.
"; $ X =-345; // negative var_dump ($ x); echo""; $ X = 0
array containing an array or multiple arrays. In PHP, the array () function is used to create arrays echo is not able to print the array directly (need to convert Json_enconde () to a string)PHP // array of values $cars=array("Volvo", "BMW", "Toyota"); // Associative Arrays $age=array("Peter" and "+", "Ben" = "Notoginseng", "Joe" and "n"); >The methods for arrays are:Gets the length of the array: count ()Traversing arrays: For/f
IsNaN: Indicates that a value is not a number
A backslash is used to wrap lines of code in a text string;
In computer programs, variables that are not valued are often declared. A variable that is not declared with a value, whose value is actually undefined. After executing the following statement, the value of the variable carname will be undefined, such as: Var carname;
1 at -Create An array named cars:1 var New Array (); 2 cars[0] = "Audi"; 3 cars[1] = "BMW"; 4 cars[2] = "
added withoutP[spec*= ' Len2 '] #包含P[spec^= ' len2 '] #开头 endP[span$= ' Len2 ']P[CLASS=SPECIAL][NAME=P1] satisfies both propertiesHttp://www.w3school.com.cn/cssref/css_selectors.aspP:nth-child (2) Select each P:nth-last-child (2) ibid., starting with the last child element count.P:nth-of-type (2) Select each P:nth-last-of-type (2) ibid., but starts counting from the last child elementVerify the CSS selector, click Elements, press CTRL +FFind #choose_car option[value= '
globalKeywords are used to access global variables within functions.PHP also stores all global variables in an array named $GLOBALS [index]. The subscript is the variable name.This array is also accessible within the function and can be used to update global variables directly.
staticKeywords are used for situations where a local variable is not required to be deleted.
echoand print the difference between:· Echo: Capable of outputting more than one string· Print: Only one string is output
{X=x + "The number is" + i + "i++;}while (IDon't forget to increment the value of the variable used in the condition, otherwise the loop will never end!Compare for And while
For statement instance
The loop in this example uses a for loop to display all the values in the cars array:cars=["BMW", "Volvo", "Saab", "Ford"];var i=0;for (; Cars[i];){document.write (Cars[i] + "i++;}
While statement instance
The loop in this example uses a while loop to di
PhpArray Sorting
The elements in the array can be sorted in descending or ascending order, in alphabetical or numerical terms.
PHP-Array sorting functionIn this chapter, we will introduce the following PHP array sorting functions:
Sort ()-ascending order of arrays
Rsort ()-Descending order of the array
Asort ()-Sets the array in ascending order based on the values of the associative arrays
Ksort ()-an array is sorted in ascending order based on the keys of the as
VariablePerson=null; Empty variablesCarname= "Volvo"; Assign to an undeclared variable, it will become a global variable, even inside the functionWindow.carnam; All data variables belong to the Window objectCharacter accessing a string: Using the location indexvar carname = ' Volvo XC60 ';var character = carname[7];var y = new String ("John"); Do not use this method to declare variablesData typetypeof [1,2,
FunctionThere is a certain function of the code body of the collection, the basic structure:function functionname () {Execute code}Base function, invocation:function Hanshu () {alert " this is the first function "}Hanshu (); function callCategory: Functions with Parameters:function Hanshu (a) {alert A}//A is a formal parameter, formal argument.Hanshu (b)//b is an argument, the actual parameter. function Hanshu sum (A, B) {alert (a+b)} sum (2,3)//parameters are assigned when called,function with
$age =array ("Peter" and "a", "Ben" = "Notoginseng", "Joe" and "43");$age =array ("Bill" = "+", "Steve" = "Notoginseng", "Peter" and "43");foreach ($age as $x = + $x _value) {echo "key=". $x. ", value=." $x _value;echo "}? >[variables to be defined outside the string?]-Object properties and objects---object methods commonly used for objectsPHP functionsThe real power of PHP comes from its function: it has more than 1000 built-in functions.To return a value to a function, use the return statement
Numbers can be numbers or objectsNumbers can be initialized with private data, just like x = 123;JavaScript numeric object initialization data, var y = new number (123);Instance
var x = 123;
var y = new number (123);
typeof (X)//returns number
typeof (Y)//returns Object
Instance
var x = 123;
var y = new number (123);
(x = = y)/is false because x are a number and Y is a object.
JavaScript string (String) objectA String object is used to process an existing b
whole is a kind of elegant tone.
View Web site http://www.nadezhda.bg/
Sonance-audition
View Web site http://sonance-audition.fr/
Game of Purpose
This is a navigation for demonstrating that the game is unlocked, they are cleverly linked together and have a good descriptive status indication.
View Web site http://gameofpurpose.com/
Edilteco
View Web site http://www.edilteco.it/it/
Keeping New York on Track
View Web site http://keepnyontrack.org/
Luxury resorts
A resort s
JavaScript is a product that follows the ECMAScript standard, the standard of natural ECMAScript to follow.
Let's take a look at the definition and usage of the VAR keyword
The Var statement is used to declare a variable.
The creation of a JavaScript variable is also called a "declaration" variable:
Copy Code code as follows:
var carname;
Variable is empty (no value) after the variable declaration.
To copy the variable, the operation is as follows:
Copy Code
Tutorial
In ASP, you can invoke the program from VBScript and other means.
Instance:
Forms using Method= "get"
How to use the Request.QueryString command to interact with the user.
Forms using Method= "post"
How to use the Request.Form command to interact with the user.
Forms that use radio buttons
How to use Request.Form to interact with the user through radio buttons.
");$result =array_intersect ($a 1, $a 2);Print_r ($result);echo "/*** Array_key_exists ()-Determine if the array key name exists*/function function: Determine whether the specified key name or index exists in the array, only one-dimensional array is applicable.$a =array ("Volvo" = "XC90", "BMW" and "X5");if (array_key_exists ("BMW", $a)) {echo "Key exists! ";} else {echo "key does not exist! ";}echo "/*** Array_merge ()-Merging arrays*/function functi
For ... In declares a loop/iterate operation for an array or an object's properties.1. For an array, iterate over the array element, and for the object, iterate over the object's attributes;var xvar mycars = new Array ()Mycars[0] = "Saab"MYCARS[1] = "Volvo"MYCARS[2] = "BMW"for (x in Mycars){document.write (Mycars[x] + "}The output is:SaabVolvoBMW2. Examples of objects:var obj = {W: "Wen",J: "Jian",B: "Bao"}for (var v in obj) {document.write (v) + "}Th
automatically declared as a global variable.This statement:Carname= "Volvo";A global variable is declared carname, even if it executes within the function.JavaScript operatorsoperator = is used to assign a value.operator + is used to add values.operator = Used to assign a value to a JavaScript variable.The arithmetic operator + is used to add up the value.y=5;z=2;After the above statement is executed, the value of X is 7.JavaScript arithmetic operato
code.GrammarBreak LabelName;Continue labelname;Continue statements (with or without label references) can only be used in loops.The break statement (without a label reference) can only be used in loops or switch.With a label reference, the break statement can be used to jump out of any JAVASCRIPT code block:Instancecars=["BMW", "Volvo", "Saab", "Ford";List{document.write (Cars[0] + "document.write (Cars[1] + "document.write (cars[2] + "Break list;doc
will return a value, and let the function end.function myFunction () { var x=5; return x;}The above function returns the value 5.Example:function MyFunction (b) { return A *b;} document.getElementById ("Demo"). innerhtml= MyFunction (4,3);The InnerHTML of the "demo" element will be: 12You can also use the return statement only if you want to exit the function. The return value is optional:function MyFunction (b) { if (a>b) { return; } x=a+B}If a is greater than B, t
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.