In PHP development, question 1: How to Use the ord () and intval () functions in PHP?
The ord () function returns the ASCII value of a character;
For intval (), if the parameter is a string, the integer represented by the first numeric string that is not a digit before the string is returned. If the first string is '-', it starts from the second string.
If the parameter is a number of characters, return the value after the value is rounded up.
Of course, the value returned by intval () is within the range (-2147483648 ~ 2147483647), the value beyond this range will be replaced by the boundary value;
Example:
- Ord ('A') = 65;
- Intval ("A") = 0;
- Intval ("1123Asdfka3243") = 1123;
- Intval (12.3223) = 12;
- Intval ("1213423423459348752347598723498572398475") = 2147483647;
- Intval ("-1213423423459348752347598723498572398475") =-2147483648;
PHP development issues 2. Why is assignment in condition warning?
I have used this in the PHP Manual: while ($ data = mysql_fetch_assoc ($ result) prompts an assignment in condition warning. After checking, I finally found that, it turns out that writing is not rigorous and is not a mistake. The solution is as follows:
While ($ row = mysql_fetch_assoc ($ result ))! = False)
So there will be no prompts.
Question in PHP development 3. Is the form submitted on this page?
<Form action = "/index. PHP" method = "post">
The address on this page following the action is shown above,
Or use $ _ SERVER ['php _ SELF '] as follows:
<Form action = '. $ _ SERVER ['php _ SELF']. 'method = "POST">
Question during PHP development 4. What is the output function?
Echo: output variable or character
Print_r: Output Array
Var_dump: returns a Boolean value.
5. What is the problem during PHP development? 5. How does Greenwich Mean Time and format time convert each other?
A) Greenwich Mean Time is converted to the specified format time
- /**
- * Convert the timestamp to Greenwich Mean Time
- *
- * We recommend that you use the gmdate/date that comes with PHP.
- */
- Function UnixToGmt ($ format_string = "Y-m-d H: I: s", $ UnixTime = 0)
- {
- Return @ gmdate ($ format_string, $ UnixTime );
- }
B) What is the Greenwich Mean Time of the current time?
$ D1 = date (mktime () + 28800; // plus the time zone difference of 8 hours
Example:
$ D2 = UnixToGmt ("Y-m-d H: I: s", $ d1); // specify the format time for the current time
Echo $ d2; // output
In PHP development, Question 6: GET the parameters passed by GET?
For example, http: // 127.0.0.1/index. PHP? Id = 3
GET the value of ID: $ _ GET [id]