The origin of things:
ProgramWhen you execute two SQL statements at the same time, for example, transfer. If one of the statements fails, the other statement cannot be executed. Otherwise, an error occurs.
PHP uses transactions to solve this
Definition and usage
The base_convert () function converts numbers in any hexadecimal format.Syntax
Base_convert (number, frombase, tobase)
Parameters
Description
Number
Required. Original Value.
Function exception_handler ($ exception ){Echo "An uncaptured exception occurred! /N ";Echo $ exception-> getmessage ();}
Set_exception_handler ('exception _ handler ');
Throw new exception ("-> as an example, an exception is thrown but not
query ("set names utf8"); // There is set_charset in mysqli (encoding can be set), and no such data is found in PDO, therefore, you can directly execute the database encoding statement/**. The following describes how to use pdostatement, mainly for
PHP vc9 is customized for IIS
Mysqld -- install mysql5.5
In PHP heredoc syntax, the end mark must be written at the top of the header, and there must be no space before it; otherwise, an error is reported.
The real power of PHP comes from
In order to export resumes, the recruitment website of the company checked a lot of information online and finally found a simple and practical method.
Principle: Specify the document type and file name. Output HTML code, so easy!
PHP exports Word
Use trim rtrim ltrim to crop a stringYou can use functions such as trim, rtrim, and ltrim to specify the beginning and end of a string.TrimRemove a stringBoth EndsSpace,RtrimIs to remove a stringTailSpace,LtrimIs to remove a stringHeaderSpace.Format:
Execute PHP with parameters under the command lineScript method:PHPIt is a scripting language, but we generally use Apache to execute PHPOf course, PHPIt can also be executed through the command line. It is similar to Perl and other languages.PHP is
PHP has been released to 5.2.10, and 5.3.0rc4 has also been released. The beta version is available early in 6.0. PHP is becoming more and more perfect. Haha
However, the linked list is an important concept in C ++. A key concept in a linked list is
// In PHP 5, you can use the _ call () method to overload the method.// The function prototype is mixed _ call (string name, array arguments)// Mixed is a pseudo-type convention. It indicates that a parameter can be of different types.
Class
$ Text = "/t these are a few words ...";$ Hello = "Hello World ";$ Binary = "/x09example string/x0a ";
# OriginalVar_dump ($ text );Echo "/N ";
# $ Text$ Trimed = trim ($ text );Var_dump ($ trimed );Echo "/N ";
$ Ltrimed = ltrim ($ text, "/T .");Var_
Introduction to PHP Execution System commands
You can use the following three methods to call external commands in PHP:
Method 1: use the special functions provided by PHP (four ):
PHP provides four specialized functions for executing external
First, open-source and free-of-chargeThe dedecms of the billing route. It can be said that the zhimeng content management system is a PHP-class CMS, which is an early open-source CMS in China! Provides basic document management functions.Group
.
After installing Apache, decompress PHP to the D: \ PHP Directory, and then configure it according to the online method. However, when the configuration ends,
"Modify the httpd. conf file of Apache. Add the following two lines at the end of the
Wamp software custom installation notes (Windows Apache MySQL PHP)1. Installation Steps① Install Apache first.Notes for installing Apache:When entering server and other information, you can fill in according to the above example of the installation
1. php and HTML mixed encoding.
2. php is case sensitive. $ A = 90 and $ A = 900 are two different values.
3. php declares a variable and assigns a value: $ A = 900;
4. Each line of PHP statement ends with a semicolon.
5. PHP is a weak data type
Requirements:
1. When you access votesys.com, you can view the list of voting items, vote, and limit the number of voting items.
2. the backend can add items for voting, and there will be verification (server verification) when adding the items)
3.
In PHP, to reduce repeated code, we often need to include heade and footer. The longest operation we use is Code such as require or reqire_once, however, we can use another method to implement this inclusion and write a function, such as printheader,
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