1, stitching stringThe concatenation string is one of the most commonly used string operations and supports three ways to stitch strings in a PHP tutorial. is a dot. Delimiter {} operation, there is also a dot equals. = to operate, the dot equals sign can decompose a longer string into several lines to define, which is
Linux 1>/dev/null 2> 1 meaning shell may often see:> the result of the/dev/null 2> 1 command can be defined in the form of %>. Output/dev/null indicates an empty Device File> indicates the redirection location, for example: echo
The shell may often see: >/dev/null 2>1
The result of the command can be defined as the output in the form of%>
/dev/null represents empty device files
> represents where to redirect, for example: echo "123" >/home/123.txt
1 indicates stdout standard output, the system default is
Shell may often see:>/dev/null 2> 1
Command results can be defined in the form of %>
/Dev/null indicates an empty device file.> Indicates the redirection location, for example, echo "123">/home/123.txt1 indicates stdout standard output. The default value is 1. Therefore, ">/dev/null" is equivalent to "
: What is the error?Warning: session_start (): open (/tmp \ sess_7d1_aa36b4c5ec13a5c1649cc2da23f, O_RDWR) failed :....Because you have not specified the path for storing session files.Solution:(1) create a folder tmp on drive C(2) open php. ini, find session. save_path, and change it to session. save_path = "c:/tmp"4: Why do I get only the first half when I send a variable to another web page, and all the v
If you have any errors or have a better idea, follow the instructions.Please carefully read the PHP manual, MYSQL manual, and settings in PHPINFO before asking questions.In addition, I hope you can read the PHP programming standard.PHP Manual1: Why can't I get the variable?Why can't I get any value when I output $ name when I POST data name to another webpage?In Versions later than PHP4.2, the default value of register_global is off.To get the variables submitted from another page:Method
1. Introduction to simple batch processing internal commands
1. Echo command
Enable or disable the request echo function or display messages. If no parameters exist, the echo command displays the current echo settings.
Syntax
gettraceasstring (); //Gettrace () information that has been formatted as a string function __tostring (); A string that can be exported}
2. Examples of capturing and handling exceptions.
The code is as follows
Copy Code
Try{$error = ' Throw exception information and jump out of Try block if (Is_dir ('./test ')){Echo ' detects that. /CH16 is a catalogue ';
1. Compile a program named rename, rename the file given by the 1st parameters, and add a string of characters contained in the 2nd parameters after the original name.Rename memol. svChange the file memol to memol. sv.// Key:[Root @ localhost ~] # Cat TestMV $1 $1 $2[Root @ localhost ~] # Chmod + X test[Root @ localhos
#!/bin/bash#Created by Ley on 2014-11-14#Testing the Paramtersecho "The Compleate list is%s\n" "$$"echo "The Compleate list is%s\n" "$!"echo "The Compleate list is%s\n" "$?"echo "The Compleate list is%s\n" "$*"echo "The Compleate list is%s\n" "[Email protected]"echo "The Com
Linux Medium Variable $#,[email protected],$0,$1,$2,$*,$$,$? the meaningLet's start by writing a simple script that will explain the meaning of each variable after execution.The script reads as follows:[email protected] ~]# cat Test.txt#!/bin/bashecho "number:$#" echo "Scname:$0" echo "First:"
Original URL: http://dadekey.blog.51cto.com/107327/119938let's start by writing a simple script that will explain the meaning of each variable after execution .# Touch Variable# VI VariableThe script reads as follows:#!/bin/shecho "number:$#"echo "Scname:$0"echo "First: $ $"echo "Second:$2"
is the key name, the number of occurrences is a key value, only the number of occurrences greater than 0 is listed
2-Array, ASCII value is the key name, the number of occurrences is a key value, only the number of occurrences equal to 0 is listed
3-string with all the different characters used
4-A string with all the different characters that have not been used
Example 1In this example, we will use Count_chars () to check the string,
process of transferring from the server. Here> means to put the things obtained by the preceding command in the following place,> and> the growth file (think of how to destroy it ??). By the way, this batch processing can also be combined with other commands to achieve a completely automated judgment of the server speed. After the execution, the fastest Server IP address is directly displayed, isn't it great? It will be detailed later.
Example 2: an
The meaning of shell variable $#,[email protected],$0,$1,$2 in Linux is explained:Variable Description:$$The PID of the shell itself (ProcessID)$!PID of the Shell's last running background process$?End code of the last Run command (return value)$-Flag at a glance using the SET command$*All parameter lists. such as "$*" in the Case of "" ", in the form of" $ $ ... $n "output all parameters.[Email protected]A
called "showinfo ()" To print the student's basic information:
The code is as follows
Copy Code
function Showinfo ()//define SHOWINFO () functions{Echo ("Name: $this->str_name”);Echo ("Sex: $this->str_sex”);Echo ("School Number: $this->int_id”);Echo ("English score: $this->int_english”);
/*1+2=33+3=66+4=1010+5=1515+6=2121+7=2828+8=3636+9=4545+10=55......*/$a =1;//Results$c Number of =2;//cycleswhile ($c $b = $c; Assign the value of C to B$a = $a + $b;//implement A+b result assignment to a a=3$c ++;//variable c plus 1, the original
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.