This is the simplest php getting started tutorial. We only need to know a few common functions to delete the last character of the string, such as substr and rtrim.
Original string 1, 2, 3, 4, 5, 6,Remove the last character "," and the final result
In php development, the undefined index error is often prompted. Let's take a look at the summary.
When $ _ post [''] and $ _ get [''] are used to obtain parameters in the form, the following error occurs: Notice: Undefined index :--------;
Server
Objects in php Include a lot of content, such as the most common php classes, interfaces, polymorphism magic methods (: _ construct (), _ destruct (), and _ clone.
Class declaration:
The Code is as follows:
Copy code
In php, The safe_mode mode is the security mode. When it is enabled, the website can be strongly secured, but it also affects some functions. Next we summarize the effect of the safe_mode mode on specific functions, for more information,
Below we have summarized several methods of page Jump in php. To achieve page Jump in php, we need to use the header function. Below I will introduce all of my friends who need it for reference.
The simplest is to use php header to implement
The
Access Control for properties or methods is implemented by adding the public, protected, or private keywords. Class Members defined by public can be accessed anywhere. Class Members defined by protected can be accessed by subclass and parent classes
A cookie is a small file sent to the browser. It can be used to record user operation records, such as accessing those files.
Write cookie
The Code is as follows:
Copy code
Setcookie (name, value, expire, path, domain
This article introduces one of the new things in php5, namely the factory model. Here are some notes about my common factory models, we will share with you the following information for your reference.
In large systems, many codes depend on a few
File Upload is divided into two parts: HTML display part and PHP processing part. HTML part is mainly used for users to select the file to be uploaded, and then received in the background through $ _ FILES in PHP, upload the file to the specified
The Singleton mode is a function in php designed to simplify development and repeat calls. Next I will introduce the usage of Singleton mode to my friends in detail.
1. Concept of Singleton Mode
As the name suggests, the singleton mode only has one
This article introduces the reference problem analysis and precautions in the php foreach loop. I hope this article will be helpful to you.
Example
The Code is as follows:
Copy code
$ Array = array ('A', 'B', 'C', 'D
I found many methods on the Internet to use Curl to forge the client source IP address, almost all of which use the curl function. Later I verified that this function is powerful, not only can the client source IP address be forged, but also the
In php, we use copy to copy files. Next we will look at a simple example. He has moved directories and directory files. I hope this article will help you.
Method 1: copy + unlink
My idea is: Move = new + Delete. Create a folder in the target
In php, variables are divided into five types: local variables, variable functions, global variables, dynamic variables, and dynamic variables. Next I will introduce these five types of php variables in detail, for more information, see.
Static
Adding watermarks to images is something that many websites will do. The following code only supports adding text watermarks to images. Currently, only English is supported, if you want this program to support Chinese characters, set $ font = \
Image Watermark code for a super simple php tutorialAdd imagecreatefromjpeg imagecreatefroatefrompng imagecopymerge imagejpeg to the image in php. As long as you set the source image and the watermark image, see the example below.*/
Header
In the php tutorial, if you want to use its image processing function, you must enable the gd library in php. ini,*/// Send the header fileHeader ("content-type: image/png ");// Create an image. If the output fails$ Im = @ imagecreate (150,50) or
Images are zoomed in and out by comparison. This function is implemented using the gd library function in the php tutorial. We will use imagecreatetruecolor () and imagecopyresampled () for operations.
Function my_image_resize ($ src_file, $
To add watermarks to images in php, We need to install the GD library for php. Here we will not introduce the installation of the GD library, but will only introduce how to use php to add text watermarks to images and add text shadow effects.
The GD
Csv files are plain text files, but they can be opened as excel files. Below I will summarize several common php instances for reading excel files.
PHP self-contained analysis. CSV function: fgetcsv
Array fgetcsv (int $ handle [, int $ length [,
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