-capable of outputting more than one string
Print-only one string is output and always returns 1
Tip: Echo is slightly faster than print because it does not return any values.1) echo is a language structure that can be used with or without parentheses: Echo or Echo ().Use the echo command to display strings and variables echo "这段话", "由", "多个", "字符串", "串接而成。";//这段话由多个字符串串接而成。2) Print is also a language structure and can be used without brackets: print or print ().4.PHP Data typesString,
Common symbols:#表示id. Represents class> represents child elements, hierarchyA space also represents a child element, but is all descendant child elements, equivalent to the relative path in XPath#input Select a node with ID input. Volvo chooses the node of the class for VolvoDiv#radio>input Select all the input nodes under the DIV with ID radioDiv#radio input selects all descendants of the input node under the DIV with ID radioDiv#radio>input:nth-of-t
1. Define an array object to store a series of values in a separate variable name. We use the keyword new to create an array object. The following code defines an array object named myArray: varmyArraynewArray () or: varshowText []; // creates an array showText. push (helloworld); // Number of push directions
1. Define an array
An array object is used to store a series of values in a separate variable name.
We use the keyword new to create an array object. The following code defines an array obj
Array_keys () functionfunction returns a new array containing all the key names in the array$a=array("Volvo"=>"XC90","BMW"=>"X5","Toyota"=>"Highlander");print_r(array_keys($a));Array ([0] = Volvo [1] = BMW [2] = Toyota)$a=array("Volvo"=>"XC90","BMW"=>"X5","Toyota"=>"Highlander");print_r(array_keys($a,"Highlander"));Array ([0] = Toyota)$a=array(10,20,30,"10");prin
1. What is an array?An array object uses a separate variable name to store a series of values. That is, the array can store all values with a variable name, each of which has its own ID, so it is easy to access any value with the variable name.2. Creating an array(1) General method:var mycars=new Array ();Myarr[0]= "Volvo";Myarr[1]= "BMW";Myarr[3]= "Saab";(2) Concise way:var mycars=new Array ("Volvo", "BMW"
world! I ' m about to learn php! This string is made with multiple parameters. Show variablesThe following example shows how to use the echo command to output variables and strings:Results:Learn Phpstudy PHP at W3cschool.cnmy car is a Volvo Print StatementPrint is also a language structure, you can use parentheses, or you can use no parentheses: Print or print ().Display stringThe following example shows how to use the Print command to output a str
Boolean (logic) can have only two values: TRUE or FALSE. var X=truevar y=false JavaScript Arrays The following code creates an array named cars: var cars=new Array (); cars[0]= "Audi"; cars[1]= "BMW"; cars[2]= "Volvo"; or (condensed array): var cars=new Array ("Audi", "BMW", "Volvo"); or (literal array): Example var cars=["Audi", "BMW", "Volvo"; The array s
code block executes before the condition is tested:Do{X=x + "The number is" + i + "i++;}while (IDon't forget to increase the value of the variable used in the condition, otherwise the loop will never end! Compare for And whileIf you have read the previous chapter about the for loop, you will find that the while loop is much like the for loop. For statement instanceThe loop in this example uses a for loop to display all the values in the cars array:cars=["BMW", "
The definition of an array:Method 1.
Copy Code code as follows:
var mycars=new Array ()
mycars[0]= "Sharejs.com"
mycars[1]= "Volvo"
mycars[2]= "BMW"
Method 2.Define and initialize together:
Copy Code code as follows:
var mycars=new Array ("Saab", "Volvo", "BMW");
Or:
Copy Code code as follows:
var mycars=["Saab", "
case sensitive
[5] The identifier should be in small hump format, the first digit should be the type of data, the common identification is as follows:
Array A-array aitemsBoolean B boolean BiscompleteFloating-point number F float fpriceFUNCTIONS fn function FnhandlerInteger i-integer iitemcountObjects O Object ODIv1Regular expression re RegExp ReemailcheckStrings S String susernameVariable V variant vanything
1.3 Variable DeclarationThe declaration format is: VAR variable name;
var n
Defining arrays
The code is as follows
Copy Code
var a = new Array ("A", "B", "C");Method 1.var mycars=new Array ()mycars[0]= "Saab"mycars[1]= "Volvo"mycars[2]= "BMW"
Method 2.
Define and initialize together:
The code is as follows
Copy Code
var mycars=new Array ("Saab", "Volvo", "BMW")
Or another way of writing:
The
The definition of JS array:
The code is as follows
Copy Code
Method 1.var mycars=new Array ()mycars[0]= "Saab"mycars[1]= "Volvo"mycars[2]= "BMW"Method 2.Define and initialize together:var mycars=new Array ("Saab", "Volvo", "BMW")Or another way of writing:var mycars=["Saab", "Volvo", "BMW"];
2, access to elements of the array
The definition of an array:
Method 1.
Copy Code code as follows:
var mycars=new Array ()
mycars[0]= "Saab"
mycars[1]= "Volvo"
mycars[2]= "BMW"
Method 2.
Define and initialize together:
var mycars=new Array ("Saab", "Volvo", "BMW")
Or another way of writing:
var mycars=["Saab", "Volvo", "BMW"];
JavaScript two-dimensional array
.
CREATE command:
Create Database user. db
Sqlite3 user. db
Create Table cars
Create table carsl (name varchar (10), years smallint, price float );
Query a table
. Table
Insert data
Insert into cars values ('audi ', 1994,530 000.5 );
Insert into cars values ('volv', 2001,303 478.5 );
Display Header
. Header on
Modify Display Mode
. Mode column
Query data
Select * from cars; // query all data in the cars table
Sqlite> select * from tbl1 where one = 'xxx ';
Delete all stateme
constructor is called as a function, and the new operator is not used, its behavior is exactly the same as when it is called with the new operator.We use the keyword new to create an array object. The following code defines an array object named MyArray:var myarray=New Array ()There are two ways to assign values to an array (you can add as many values as you want to define as many variables as you need).1:var mycars=New Array () mycars[0]="Saab"mycars[ 1]="
) matches from the beginning, returning the first position where the match succeeded (G invalid) Obj.match (rege XP) Global Search, if there is a G in the regular means find all, otherwise only find the first one. Obj.replace (regexp, replacement) replaced, there is g in the regular replaces all, otherwise only the first match, $ number: matches the nth group content; $: The content of the current match; $ ': text that is lo
Echo and print:echo-can output more than one stringPrint-can only output a string. And always returns 1Tip: Echo is slightly faster than print, because it does not return whatever value.php$txt1= "Learn PHP"; $txt 2= "W3School.com.cn"; $cars =array ("Volvo", "BMW", "SAAB");p rint $txt 1;print "Five, string and integer1) The string is a sequence of characters, for example "Hello world!".The string can be any text within the argument. You can use singl
-----------------------------------------------------------------------------------------var cars = ["Saab", "Volvo", "BMW"]; Arrayvar x = {firstName: "John", LastName: "Doe"}; Object---------------------------------------------------------------------------------------- JavaScript Evaluates expressions from left to right. Different sequences can produce Different results: var x = + 4 + "Volvo"; Result:20
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.