The array function in PHP allows you to access and manipulate arrays. Supports simple arrays and multidimensional arrays. The PHP Array function is part of the PHP core. These functions can be used without installation.
Definition and usage
The array () function is used to create arrays. In PHP, there are three types of arrays: Valarray-array associative array with numeric ID key-an array with the specified key, each key associated with a value, multidimensional array-syntax for array syntax ar
Take out the key value of the associative array and use Array_keys ().1 PHP 2 $a=array("Volvo" = "XC90", "BMW" = "X5", "Toyota" and "Highlander"); 3 Print_r (Array_keys($a)); 4 ?>Output results1 Array ([0] = Volvo [1] = BMW [2] = Toyota)Take out the values of the associative array and use Array_values ().1 PHP 2 $a=array("Name" = "Bill", "age" = "all", "country" = "USA"); 3 Print_r (array_values($a)); 4 ?>O
JavaScript variable names:Variables are case sensitive (Y and Y are two different variables)The variable must start with a letter or an underscore7.Declaration of a variableIf the variable you are assigning has not been declared, the variable is automatically declared.Cases:x=5; Carname= "Volvo";The effect of these statements is the same as the following: Var x=5; var carname= "Volvo";8.Comparison operator
page.When JavaScript is inserted into an HTML page, it can be performed by all modern browsers.JavaScript is easy to learn.JavascriptData TypeA string (string), a number, a Boolean (Boolean), an array, an object (objects), null (NULL), undefined (Undefined).JavaScript has a dynamic typeJavaScript has a dynamic type. This means that the same variables can be used for different types:Example var x; X is undefinedvar x = 5; Now X is the numbervar x = "John"; Now X is a stringJavaScript stringA str
Choshun: Building a personalized brand culturethe distinctive and rich brand culture is the important characteristic that consumers differentiate similar products and form psychological identity. Only the brand culture is unique and distinctive, it is convenient for the consumers to identify and promote the brand competition. To build a strong brand competitiveness, we must make the brand unique personality. Mercedes-Benz, BMW, Rolls-Royce, Volvo, etc
for="male">Male
type="radio" name"sex" id="male"/>
for="femal">Female
type="radio" name="sex" id="female"/>
The The label element does not present any special effects to the user. However, it improves usability for the user of the mouse. This control is triggered if you tap text inside a LABEL element. That is, when the user selects the label, the browser automatically shifts the focus to the label-related form controls.The For property of the Text fields: The name value is the
Shanghai waste Yi Mechanical and Electrical Equipment Recycling Co., Ltd.: Shanghai used diesel generator set recycling, imported generator set recycling, the company long-term acquisition of second-hand equipment, waste disabled mechanical and electrical materials. Contact: Mr. Ye Tel: 021-51095947 13661585442
The company has long-term acquisition of second-hand generators, second-hand diesel generator sets: Recycling imported, domestic generators, 50mw--5000mw recycling second-hand generators
things. One of the key aspects of project team member management is to create a sense of participation, which can be explained in the words of the Volvo company's president, Pell Greenham: "I want the workers to say when they return home at night, 'The car was produced by me. '"
In the project team, we need to minimize the competition among members. On the one hand, it is because no one can truly compete and cooperate, and on the other hand, as said
Arris-22 marketing rules (22 Business Rules)
6. proprietary concepts and regulations
Two different companies cannot share the same concept with users.
When your competitors have formed a certain concept or position in the user's mind
If you want to win users with the same concept, the results will be futile.
As we mentioned earlier, Volvo Auto has "security" in users' minds"
This concept involves many other car manufacturers, including Mercedes. Benz
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
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.