#define name [string]Macro definition. When compiling preprocessing, all occurrences of macro names in the program are replaced with strings in the macro definition... Variable parameter, used to pass a mutable argument list, you can use __va_args__ to get a mutable argument list#define Debug (...) printf (__va_args__)#define Debug (format, ...) printf (format, __va_args__)#define Debug (format, ARGS ...) printf (format, args)# string, enclose the corresponding parameter in
--------------siwuxie0951,. : Point or dot or period or full stop 2. Space : space or blank -------------------------------------------------------------------------------------3,: less or less than or angle bracket 4,>: Greater or more or greater than or more than or angle bracket 5,? : Question or question mark 6,/: slash or divide or oblique 7,\: backslash or escape 8,": Double quote or quotes or quotation mark or second 9,*: asterisk or star or pointer or multiply 10,:: Colon 11,| : Pipe
(read or write), you must call the Pclose () function to close it.
Example 1:
$FP =popen ("/bin/ls-l", "R");
?>
Example 2 (This example is from the PHP China Alliance website http://www.phpx.com/show.php?d=coli=51):
/* How to add a system user in PHP
Here is a routine that adds a user named James,
The root password is verygood. For reference only
*/
$sucommand = "Su--login root--command";
$useradd = "Useradd";
$ROOTPASSWD = "Verygood";
$user = "James";
$user _add = sprint
Alliance website http://www.phpx.com/show.php?d=coli=51):/* How to add a system user to PHP below is a routine that adds a user named James, and the root password is verygood. For reference only * * $sucommand = "su--login root--command"; $useradd = "Useradd"; $roOTPASSWD = "Verygood"; $user = "James"; $user _add = sprintf ("%s"%s "%s", $sucommand, $useradd, $user); $fp = @popen ($user _add, "w"); @fputs ($fp, $ROOTPASSWD); @pclose ($FP);?> 3) Use the anti-
A new character of string--double 丿 (apostrophe) declaration string, multi-line stringvar myName = ' FangMy Hao LiJsk c SDF '//this will not Error., String templatesConsole.log (' Qsdaf ${myname} ')Console.log (' Qsdaf ${myname ()} ')//functions and variables can be written directly inside the ${}Console.log (' , auto-split character stringFunction Test (a,b,c) {Console.log (a);Console.log (b);Console.log (c);}var myname = ' Ni hao ';var getage = func
apostrophe (') represents the interruption and tracking. Calculates the number of apostrophes at the end of the day. If you do not intend to make a note today you represent unplanned (unplanned).The best strategy for dealing with internal outages is to visualize, accept, plan, or delete. Rule: "Once the tomato bell starts it must go to the bell." ”Tomato clocks are atomic and indivisible. It is the smallest unit of money for this process. If the task
class variableThe function definition in the shell does not need to write parameters, the function body calls parameters with $1,$2,....., passing parameters directly after the function name to add Parameters!Example: Sum ()Script:1 #!/bin/bash2 sum ()3 {4 a=$15 b=$26 n= ' expr $a \* $b '7 echo "N is $n"8}9 Sum $10Execution effect:[Email protected]:~/workspace/shell#./9.sh 2 36The return value of the function is called with a counter-apostrophe:Return Status:1. Return returned value,2. No retur
left parentheses) Close parenthesis, close the right parentheses of Paren() Brakets/parentheses brackets[Open bracket left square brackets] Close Bracket right square brackets[] Square brackets. Period, dot full stop, Point| Vertical bar, vertical virgule vertical line Ampersand, And, reference, ref and, reference* Asterisk, multiply, Star, pointer asterisk, multiplication number, Star, pointer/Slash, divide, oblique slash, slash, division sign// Slash-slash, comment double slash, annotator# Po
used --- #20; --- unused not used --- #21; --- unused not used --- #22; --- unused not used --- #23; --- unused not used --- #24; --- unused not used --- #25; --- unused not used --- #26; --- unused not used --- #27; --- unused not used --- #28; --- unused not used --- #29; --- unused not used --- #30; --- unused not used --- #31; --- unused not used #32; --- space! #33; --- exclamation mark " #34; quot; double quotation mark # #35; --- Digit Sign number sign $ #36; --- dollar
, make sure it contains the appropriate values.
5. Be careful with functions that execute commands on any server.
These functions include eval (), exec (), System (), PassThru (), Popen (), and anti-apostrophe ("). These functions are capable of executing commands on the server and should never be used arbitrarily. If you have to include that in the command, you should have a thorough security check on the variable. Additional preprocessing shoul
line. In this case, it is obviously not possible to use the method mentioned above.
The Popen () function opens a process pipeline to execute the given command, returning a file handle. Now that you have returned a file handle, you can read and write to it. In PHP3, the handle can only be done in a single mode of operation, either written or read, and starting from PHP4, you can read and write at the same time. Unless the handle is opened in a pattern (read or write), you must call the Pclose (
command line. In this case, it is obviously not possible to use the method mentioned above.
The Popen () function opens a process pipeline to execute the given command, returning a file handle. Now that you have returned a file handle, you can read and write to it. In PHP3, the handle can only be done in a single mode of operation, either written or read, and starting from PHP4, you can read and write at the same time. Unless the handle is opened in a pattern (read or write), you must call the
contains the appropriate values.
5. Be careful with functions that execute commands on any server.
These functions include eval (), exec (), System (), PassThru (), Popen (), and anti-apostrophe ("). These functions are capable of executing commands on the server and should never be used arbitrarily. If you have to include that in the command, you should have a thorough security check on the variable. Additional preprocessing should also be done usin
"value = 3"
echo "value = \{$var}"; Print Result "value = {3}"
Three, Slash, and SQL statements
Generating HTML code or SQL query statements is a common and interesting thing to do when writing PHP programs. Why do you say that, because this involves generating another type of code, you must carefully consider and follow the writing syntax and rules required by this code.
Let's look at an example where you want to query the database for users whose names are "O ' Keefe", usually in the form
(read or write), you must call the Pclose () function to close it.
Example 1:
$FP =popen ("/bin/ls-l", "R");
?>
Example 2 (This example is from the PHP China Alliance website http://www.phpx.com/show.php?d=coli=51):
/* How to add a system user in PHP
Here is a routine that adds a user named James,
The root password is verygood. For reference only
*/
$sucommand = "Su--login root--command";
$useradd = "Useradd";
$ROOTPASSWD = "Verygood";
$user = "James";
$user _add = sprint
, Birk, blugle, back tick, back glitch, push, (opening single quotation mark), quasiquote.
That's nice, but what is the symbol used? It has no operating system function in DOS or Windows (although it does find use in the UNIX operating system ), and in most type fonts doesn't match the appearance of an ordinary single quote (apostrophe), so it can't really be used as an Open quote Mark. however, programmers, being loath to let extraneous keys sit
languages, such as JavaScript, can be embedded in the CDATA zone.Pcdata: The character data to be parsed by the XML parser.Directly write the content between the start tag and the end tag.
Character escapeSome special characters cannot appear in the pcdata area and must be replaced by character entities, such as Lt Gt> Amp ampersand APO 'apostrophe Quot"XML annotation is the same as HTML The XML Document declaration must be the first line of code,
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.