I recently learned the Python language and encountered the conversion problem between data types. See an articleArticleThe summary is quite detailed.
Type conversion
Code
Code highlighting produced by Actipro CodeHighlighter (freeware)http:/
US-ASCII encryption is to convert 7bit to 8bit
Original code
Program code:Program code sprite's blog http://www.spr1t3.com Encrypted code
Program code:Program code ie These two problems are as follows: are you sure you want? Encryption and
JSON (JavaScript Object Notation) is a lightweight data exchange format. It adopts a completely language-independent text format and is an ideal data exchange format. JSON is a native JavaScript format, which means that no special API or toolkit is
Function Description
Int (x [, base]) converts x to an integer.
Long (x [, base]) converts x to a long integer.
Float (x) converts x to a floating point number.
Complex (real [, imag]) creates a plural number
Str (x) converts object x to a
Syntax: void eval (string code_str );
Return Value: None
Function Type: Data Processing
PHP function eval () Description
The PHP function eval () can be used to substitute variable values in strings for processing database data. The code_str
JavaScript and javascript tutorials
JSON rules are simple: the object is an unordered set of 'name/value' pairs. An object starts with "{" (left parenthesis) and ends with "}" (right Parenthesis. Each "name" is followed by a ":" (colon); "," (comma)
Eval definition and usageThe eval () function calculates the string according to the PHP code.
The string must be a valid PHP code and must end with a semicolon.
If the return statement is not called in the code string, NULL is returned. If a
Json2.js
JSON string:Var str1 = '{"name": "cxh", "sex": "man "}';JSON object:Var str2 = {"name": "cxh", "sex": "man "};
1. convert a JSON string to a JSON object
To use str1 above, you must use the following method to first convert it to a JSON
1. Create a regular expressionMethod 1: note that the regular expression here cannot use single or double quotation marks, as shown below:
Var pattern1 =/[abc]/I; // match the first "a" or "B" or "c", case insensitive
Method 2: Create using RegExp
int (x [, Base]) converts x to an integer
Long (x [, Base]) converts x to a long integer
Float (x) converts x to a floating-point number
Complex (real [, Imag]) creates a complex number
STR (x) converts an object x to a string
REPR (x) converts an
Easy to master the eval () PHP function application skills. Syntax: voideval (stringcode_str); return value: no function type: data processing PHP function eval () content description PHP function eval () can be substituted into the variable value
1. Create a regular expressionMethod 1: note that the regular expression here cannot use single or double quotation marks, as shown below:Var pattern1 =/[abc]/I; // match the first "a" or "B" or "c", case insensitiveMethod 2: Create using RegExp
Okay? $ Text e-book library; preg_match_all ([x80-xff]?., $ Text, $ ar); foreach (encoding conversion between gb2312 and unicode
The following example converts gb2312 to "full ".
The iconv function after php4.3.1 is very useful, but you only need
This article mainly introduces three methods for parsing JSON data in JavaScript. This article describes the eval () method, newFunction method, JSON. parse () method and other three methods. For more information, see
Overview
At present, the JSON
JSON is a JavaScript Native format, that is, processing JSON data in JavaScript does not require any special APIs or toolkit. Next, this article describes how to process and parse JSON data using JavaScript. if you are interested, please refer to
Evalwith theWindow.evalthe DifferenceAre there any differences between them?Few people seem to add an extra windowin the development processand feel superfluous. such as The callback function in the Ajax process to parse the JSON format string1 ...
Meta-language programming, are used in the most flexible place.
The most recent task is to design an extremely flexible test item, and the biggest difficulty is that several sets of test papers have different scoring rules.
If you want to follow
This article mainly introduces the eval () function of PHP and the example of its use. This article provides a special example, which is to use eval nested for execution in a loop. For more information, see
What is eval ()?
The eval () function
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.