Some people like to add a slash, for example, $ dir = dirname (_ FILE __). '/'; while some people are too troublesome and the code is not beautiful, use $ dir = dirname (_ FILE __); in this way, problems may occur when we want to include files. For
Use \ \ or see how you define the string. In fact, there are only two escapes: PHP and MySQL.
In PHP, if you define a string with double quotes, there is an escape here. If you use single quotes, you do not escape.$sql = "SELECT * FROM table WHERE
Problem Description
Connect the prefix name URL to the address: http://127.0.0.1/zt/n4/, change to: http://127.0.0.1/zt/n4/
Why did you do that?
When a Web server receives a URL request with no slash at the end, for example:
In the project, the foreground data is the JSON string, because there is no suitable entity to these fields, all in the simplest way: intercept the string.
The foreground JSON string is:
string S1 = "[{\ id\": \ "99d2a341-ea2e-4f04-b4f4-623153d643
Implementation code:
Copy Code code as follows:
function Addslashes_deep ($value)
{
The most classic recursion in history, one line.
Return Is_array ($value)? Array_map (' Addslashes_deep ', $value): Addslashes ($value);
}
The title is the same php, for example, I started in incloudconfig. phpwebinclude_once & #039; configconfig. php & #039; in dos, it must be changed to include_once & #039; configconfig. php & #039; the key point is that the boss asks "the same
Like what
domain.com/index.php/user/123
What is the meaning of this writing?
How is compatibility? are all PHP servers and browsers supported
Is this a standard notation?
Reply content:
Like what
domain.com/index.php/user/123
{Code...} How can this problem be solved? Supplement: {code...} result: {code ...}
$array = array( 'code_pattern' => '\d{6}');//okprint_r(json_decode(json_encode($array),true));//errorprint_r(json_decode('{"code_pattern":"\\d{6}"}',true));
How
The code is as follows:
Echo ' mysqldump-h localhost-u$dbuser-p$dbpwd--default-character-set=utf8 $DbName >/var/$dumpFileName ';
Other uses of anti-apostrophe
The server timestamp is: $result"; echo "
"; #使用shell_exec () $result
#include void Main () {//00-11-22-33 the first slash is the second 10-21-32 int arr2[4][4] =
{00, 01, 02, 03, 10, 11, 12, 13, 20, 21, 22, 23,
30, 31, 32, 33,};
int I, J;
int sum = 0;
int
allowed. However, if there are single quotation marks between strings, we use two output methods: use double quotation marks to output or escape string quotation marks. Correspondingly, if there are double quotation marks between strings, we can use single quotation marks or escape string quotation marks. The escape method is to add a backslash before the quotation marks in the string.
When outputting strings, you can use '+' to concatenate two outpu
that this is a merge operation.>>> T2 = "Test" 'for' "diege">>> T2'Test for diege'>>> T2 = "Test" + 'for '+ "diege">>> T2'Test for diege'You cannot add a comma (,) to a string to create a tuple instead of a string. Python tends to print all these form strings as single quotes, unless the strings contain single quotes.However, quotation marks can also be embedded through backslash escape.>>> T2 = "Test" + '
?? Statements and syntax?? Variable assignment value?? Identifiers and keywords?? Basic style guide?? Memory management?? The first Python program 3.1 statements and syntax Python statements have some basic rules and special characters:?? The pound sign (#) indicates that the following character is a Python comment?? line break (\ n) is a standard line delimiter
positions. This flexibility allows Python to easily retain regular text data. These regular text data may need to use single quotes to represent abbreviated verb forms or associations, and use double quotes to represent quoted text.
Second, if a string is too long in one line, you can use the Python continuous character: backslash (\) to fold the string. From th
?
Multiple statements written in the same row of books are separated by a comma (;).
5. Statements. In Python, can a statement be divided into multiple lines for writing?
Write multiple lines of books. Add a backslash (\) to the headers of the line of statements.
6 variable assignment
(A) What values will be assigned to the values x, y, z = 1, 2, and 3 in x, y, and z?
X = 1 y = 2 z = 3
(B) After z, x, y = y
number (a+bi).
( )
Brackets, same as C language
( )
Four, stringThe string (str) in Python can be enclosed in single or double quotation marks, and single and double quotes can be nested with each other. Examples of official documents are:1>>>'Spam eggs' #Single quotes2 'Spam eggs'3>>>'doesn\ ' t' #Use "to escape " the single quote ...4 "doesn ' t"5>>>"doesn ' t" #... or use double quotes instead6 "doesn ' t"
, no Long in python2.
Bool(Boolean), such as true.
Float(Floating point number), such as 1.23, 3E-2
Complex(Plural), for example, 1 + 2j, 1.1 + 2.2j
Python can assign values to multiple variables at the same time, a = B = c = 1
You can also specify multiple variables for multiple objects. Example: a, B, c = 1, 2, "hello"
This instance assigns integer objects 1 and 2 to variables a and B, and string objects "hello" to variable c.
You can
concept of escape characters.Suppose you want to include a single quotation mark (') in a string, how do you indicate this string?
For example, the string is: What's your name? You certainly won't use what's your name? 'To indicate it, Because python will not understand where the string starts and ends. Therefore, you must specify single quotes instead of the end of the string. You can use escape characters to complete this task. You use \ 'to indica
. findall ('o {3}', st) # match 3 o characters print (result)
{M, n}: match the m-n times of the previous character
import rest = 'I loooove python'result = re.findall('lo{1,4}ve',st)print(result)
[Abc] or [a-c]: match any character in []
import rest = 'I loooove python'result = re.findall('l[0-z]*e',st)print(result)
[A | B]: Match character a or character B
import rest = 'I lbve python'result = re.findall('l[a|b]ve',st)print(result)
[^ 1-9]: [] contains the ^ character, indicating non-meaning,
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.