Example 1
The code is as follows
Copy Code
Header ("Content-type:image/png"); /* Notification browser, to output the image * *$im = Imagecreate (400, 300); /* Define the size of the image * *$gray = Imagecolorallocate
When you jump through the header of PHP (' location:http://www.111cn.net '). Sometimes it doesn't work. There are several reasons to follow:
Wrong spelling
location and ":" No spaces between the number, or there will be an error.
• You cannot
We may often see such a function in the program
The code is as follows
Copy Code
function seterrorreporting (){To read from a configuration file whether it is currently a development environmentif (dev_env = = True)
There are three ways to build a PHP environment on IIS, and the pros and cons are as follows:
1, the CGI load PHP environment, is usually IIS inside the configuration interpreter for Php.exe, early more common, currently use less. Characteristic is:
10 days to learn the first day of PHP Use Apache Web server and my SQL as Web servers and databases under the php-4.3.3 environment to do a simple build and access view database with phpMyAdmin. Syntax for PHP: 1. Embedding Method: PHP can be a 2.
When we normally use PHP to send mail, we don't always need to use a powerful tool class like Phpmailer, and find a nice PHP mail encapsulation function on the Internet that solves several problems that are frequently encountered using the mail ()
A Domain name is any combination of a specific character set, English letters, numbers, and "-" (that is, hyphens or minus signs) in each country's text, but neither the beginning nor the end can contain a "-", "-" that does not appear
Build PHP Environment
Because I use the computer is a Mac, so recommend that you use Mamp Pro this software, but the fee version, I believe you do not want to spend money will have a way to fix!
Mamp Pro This software is integrated environmental
Abstract class and interface differences in PHP:
1, the use of the interface is through the keyword implements. The use of abstract classes is extends by keyword. Of course, interfaces can also be inherited with extends. Abstract keyword to define
PHP's serialize is to serialize the variable, returning a string expression with variable type and structure, while JSON is a lighter and friendlier format for interface (AJAX, rest, and so on) data interchange. In fact, both are in a string of ways
Replace the phone number string with the asterisk code: The code is as follows:Copy code $ Str = "15832818835 ";Echo substr ($ str,). '*****'. substr ($ str, 8, strlen ($ str); // retain the first and last three digits?>Or use regular
By default, the php syntax error prompt is not displayed in ubuntu. To enable the syntax, you need to modify the following:1. Open the php. Ini file.This file is in the/etc/php5/apache2 Directory. You must modify the permission of this file to write
What is an array?An array is a collection of data, which is equivalent to a container. Data can be stored in this container according to certain rules. This is equivalent to a hotel. There are many rooms in the hotel, and the rooms are numbered
PHP/GTK (reprinted)Published on at PM in PHP Programming ForumIn the past, PHP was considered to be only used to write CGI programs on the server. If PHP can develop GUI (Graphical User Interface) programs in Windows, do you believe this? Recently,
Let's take a look at the PHP array_diff () syntax.Definition and usageThe array_diff () function compares two or more arrays and returns the entry and value of an array from the first array, only when the value is not in any other
Let's take a look at the xin. Sqldatabase first. We can copy and save it as xxx. SQL. The code is as follows:Copy code Use xin;Create table bbs_post (Id int (11) not null auto_increment,Title varchar (255) not null,Username varchar (255) not
PHP obtains the server IP addressRun ifconfig in PHP to get the Linux server IP address and output it as an array. The following code is used: The code is as follows:Copy code Function getServerIp () {// use ifconfig to read the server IP
We are not used to the variable scope in PHP. Function variables in PHP are completely isolated from the global ones, that is, they cannot access each other.For example:Copytext The code is as follows:Copy code $ Test = 123;Abc (); // nothing is
Several key functions.Is_dir ($ dirname) // determines whether a file name is a directory.Opendir ($ dirname) // open a folderReaddir ($ dir_stream) // the function returns the entries in the directory handle opened by opendir ().Pathinfo ($ path) //
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