Value Transfer and reference transfer exist in PHP. The latter must use the address operator & to identify the variable. The following is an example of assigning values:
1, Value transfer
1) Basic data types:
\ $ A =". $ .""; Echo"\ $ B =".
Substr (STR, start, length );
Example: substr ('php is very good language );
Output is ve;
If the length of Start> STR is returned ();
Substr ('php is very good language );
Substr ('php is very good language ',4);
Output as (blank)
The nl2br () function can convert a line break in a string into a line break in HTML.
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--> PHP $ Str = " It has been raining for the past
PHP string functions include the character location search function, the sub-character extraction function, the replacement string, the character length, the comparison character function, the array character, and the space.
String functions
ArticleDirectory
Example 1
Example 2
Define () Definition and usage:
The define () function defines a constant.
Constants are similar to variables, except that:
After setting, the constant value cannot be changed.
For more information, see the following:
Storm blog http://www.laruence.com/2008/08/12/180.html
Baidu R & D center's blog http://stblog.baidu-tech.com /? P = 763
Wang xingbin's blog http://blog.csdn.net/wanghao72214/article/details/3916825
Testing a PHP program todayProgramWhen you find this problem:
Forbidden
You don't have permission to access/on this server.
At the beginning, I used http: // localhost/test. no problem was found in the test conducted by PHP. Later, you
Recently I am working on a PHP and. net project, receiving. I was surprised to find that the MD5 result was different from that of PHP. Why?
. Net endProgramIt is written in this way:
System. Text. asciiencoding encoding = new system. Text.
1. Call the PHP file in JS mode and obtain the value in PHP.
Here is a simple example:
For example, you can call the following statement in page a.html:
In B. php, there is such a PHPCode:
B. PHP file, and.
There are several kinds of Chinese spaces: There is no simple solution to the problem, such as halfwidth and fullwidth spaces. For example, the Section characters are displayed as blank and people may misunderstand that it is a space, therefore,
There are hundreds of folders, such as idr_web_bkg_png, idr_web_bkg_xml, idr_web_bkg_ico, files, and manually update suffixes one by one. It is too troublesome to use PHP for batch update,CodeAs follows:
$ Dir = ' D: \ Program Files \
Me, an old man ProgramEmployee It is also a student who has played many languages and is mostly not refined. I am neither a famous-name school nor a high degree of education, but only a part of the people who are quite cool. Contact PHP It was also
We often need to determine whether a mobile phone is accessed and then perform automatic jump operations. This is a function separated from a PHP framework to determine whether it is a mobile phone.
Sometimes it is very useful in some scenarios.
Introduction to PhP Filter
PHP filters are used to verify and filter data from unsafe sources (such as user input.Install
The filter function is a core component of PHP. These functions can be used without installation.PHP Filter Function
PHP:
Today, we have a small web that needs to run in a PHP environment. It has worked hard to configure it! Finally, the following information is displayed:
We know several PHP configurations:
1. cgi PHP environment. Generally, php.exe is used as the
Tip: some tips for improving PHP program efficiency use single quotes instead of double quotes to include strings, which is faster. Because PHP will search for variables in strings enclosed by double quotes, but not in single quotes. Note: Only ECHO
Addcslashes -- add backslash escape characters to some characters in the string
Addslashes -- escape characters in a string in a specified way
Bin2hex -- convert binary data to hexadecimal Representation
Chr -- returns the ASCII code of a character.
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service