Php coding and Chinese garbled characters solution
[Mysql]
Default-character-set = utf8
[Mysqld]
Default-character-set = utf8
Default-storage-engine = myisam
Add the following under [mysqld:
Usage of PHPini_set and ini_get functions
Share the usage of ini_set and ini_get functions in PHP. if you want to learn php programming, follow these steps.The ini_set function in php is a function that comes with php to modify and set
Php string filter and conversion functions
This article describes several useful php string filtering and conversion functions for character security and string processing.Includes the following string filtering and conversion functions:
An example of php access control questions
Class Foo
{
Private $ name = 'hdj ';
Public function getName (){
Return $ this-> name;
}
}
Class Bar extends Foo
{
Public
Phppdo function library usage
Pdo-> begintransaction ()-indicates the start point of rollback
Pdo-> commit ()-indicates the rollback end point and executes the SQL
Pdo->__ construct ()-Create a pdo-linked database
PHP file size limit two solutions
Upload_max_filesize = 8 M
Post_max_size = 10 M
Memory_limit = 20 M
In addition, to confirm the Upload
There is no line similar to the following:
Modify the PHP file size limit
This section describes how to modify the php file size limit. the default file upload size in php is 2 MB. here we will share the specific modification method. For more information, see.1. in php, the
How to connect PHPMySQL to the database
$ Con = mysql_connect ("localhost", "peter", "abc123 ");
If (! $ Con)
{
Die ('could not connect: '. mysql_error ());
}
// Some code
?>
Sample code for filling white edges with a php thumbnail
// Source image path, which can be a local file or remote image
$ Src_path = '1.jpg ';
// The width of the final saved image
$ Width = 160;
/
Create a database and a table in PHPMySQL
// Create a database
$ Con = mysql_connect ("localhost", "peter", "abc123 ");
If (! $ Con)
{
Die ('could not connect: '. mysql_error ());
}
Simple example of exporting CSV files in php
/**
* Export a csv file. example of the header function
* Edit: bbs.it-home.org
*/
Header ("Cache-Control: public ");
Header ("Pragma:
Basic phpgd Library knowledge
Echo phpinfo ();
?>
Save, open phpinfo. php in the browser, search for 'gd ', and check whether the following items exist:If yes, the system supports the GD Library.
Install phpgd Library in linux
Tar xzvf zlib-1.2.3.tar.gz
Cd zlib-1.2.3
./Configure
Make
Make install
2. install freetype
Tar xzvf freetype-2.2.1.tar.gz
Cd freetype-2.2.1
./
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