PHP Picture plus Chinese watermark implementation code

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

PHP PDO connect and query SQL database code

$login = "root";$passwd = "MySQL tutorial";try{$db =new PDO (' Mysql:host=localhost;dbname=mysql ', $login, $passwd);foreach ($db->query (' SELECT * from Test ') as $row) {Print_r ($row);}$db =null;}catch (Pdoexception $e) {echo $e->getmessage ();}

Some problems needing attention when PHP header function jumps

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

PHP error_reporting (e_all ^ e_notice) some data collation

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)

IIS7+FASTCGI Configuration PHP Environment in Windows

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 learn to write PHP dynamic website

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.

Using the PHP mail function to deliver a mailbox

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 ()

PHP Verify mailbox and mailbox validation

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

PHP simple to write app interface program example

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

Differences and examples of abstract classes and interfaces in PHP

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

Examples of PHP's serialize serialization data and JSON formatted data

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 php string with an asterisk or other characters (mobile phone number, ID card)

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

How to enable PHP error prompt in Ubuntu

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

Php array operation learning Notes

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)

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,

PHP array_diff () and array_diff_key () functions

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

Ajax + php do not need to re-post and register for verification instances

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 IP address and outputs the code as an array program.

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

Use PHP Global to define Global variables

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

PHP batch modify file name/file suffix (extension)

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) //

Total Pages: 12780 1 .... 1484 1485 1486 1487 1488 .... 12780 Go to: GO

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.