1. In PHP, global variables are capitalized;
2. In the php form submission method, the method property sets the way to obtain and submit the data;
3. If you use the upload element in your form, add attributes to the form: enctype= "Multipart/form-data";
4. Cancellation of user function implementation:
Copy Code code as follows:
<?php
Session_Start (); Start session
unset ($_session[' user '); Delete a single session
unset ($_session[' pwd ')); Delete a single session
Session_destory (); End Current reply
Header ("location:index.php"); redirect
?>
Delete Multiple sessions: $_session=array ();
5.php Traversal of objects:
Copy Code code as follows:
For ($i =0 $i <count ($_post["name"); $i + +) {
Processing
}
6.php contains files: include ("File path");
7. Embed the JS script in the HTML page way:
Copy Code code as follows:
<script language= "JavaScript" >
JS function
</script>
8. Refer to JS file in PHP dynamic page:
Copy Code code as follows:
<script language= "JavaScript" >
JS function
</script>
Or:
<script language= "Javascript" src= "url" >
JS function
</script>
9. Solution Browser does not support JavaScript issues:
A. Open IE browser to JavaScript support;
B. Open IE browser support for local javascript;
C. Apply the annotation symbol to verify that the browser supports JavaScript script functionality;
D. Apply <noscript></noscript> tag Verify that the browser supports JavaScript scripting.
10. In PHP, single quotes and double quotes have different processing mechanisms, and their differences are:
The contents of double quotes can be interpreted and replaced, while the north wing of single quotes is treated as ordinary characters. Such as:
Copy Code code as follows:
<?php
$test = "PHP";
$str 1= "I like $test";
$str 2= ' I like $test ';
Echo $str; Output: I like PHP;
Echo $str; Output: I like $test;
?>