PHP Generation thumbnail Classic class

The code is as follows Copy Code /** File:SimpleImage.php* Author:simon Jarvis* copyright:2006 Simon Jarvis* date:08/11/06* link:http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php** This are free software; You can

PHP mb_substr Implementation of Chinese string interception without garbled method

Note: Find php.ini in Windows directory Open edit, search Mbstring.dll, findExtension=php_mbstring.dll the front of the number, so the MB_SUBSTR function can be effective Example The code is as follows Copy Code $str = '

PHP implementation character Fu Jing URL implementation code

English: The code is as follows Copy Code function Tourl ($STR) {$str = preg_replace ('/[^a-za-z0-9]+/', '-', $str);$str = Trim ($str, '-');Return Strtolower ($STR);} Contains special characters:

PHP Database backup Restore function

Backup Restore functions The code is as follows Copy Code function Write_file ($sql, $filename) {$re =true;if (!@ $fp =fopen ("./www.111cn.net/". $filename, "w+")) {$re =false; echo "failed to open target file";}if (!

Conversion of Chinese Pinyin to Php

$d =array ( Array ("A",-20319), Array ("AI",-20317), Array ("an",-20304), Array ("Ang",-20295), Array ("AO",-20292), Array ("BA",-20283), Array ("Bai",-20265), Array ("Ban",-20257), Array ("Bang",-20242), Array ("Bao",-20230), Array

Introduction to a simple mailbox sending component in PHP

The code is as follows Copy Code Include (' class/class.phpmailer.php '); $config = Array (' Host ' => ' smtp.163.com ',' Port ' => ' 25 ',' User ' => ' * * *,' passwd ' => ' * * * *,' From ' => ' juva_zz@163.com ',' FromName ' => '

Example of PHP using Preg_replace to replace HTML code

Example Comment on the expression using the label 1 to 60. The corresponding picture path/public/images/face/1.gif to/public/images/face/60.gif. The implementation method is to use the Preg_replace function to complete the display of the comment

The simplest tutorial on string matching algorithms in PHP

This article illustrates the simplest method of string matching in PHP, which is implemented as follows: The code is as follows Copy Code /*The simplest string matching algorithm PHP implementation methodT:ababcabcP:abc0.1

PHP scripts for uploading multiple files

Note: The original name of this article is Creating a Multi-File Upload Script in PHP. I think this article is generally written, and the code is not very professional, but it is short, and I can't find a better article at a time, so I translated it.

Settings required for uploading large files in PHP:

Needless to say, you have to find the PHP configuration file php. ini :)Open php. ini, first find;;;;;;;;;;;;;;;;; File Uploads;;;;;;;;;;;;;;;;;Region, which has the following parameters that affect file upload:File_uploads = on; whether to allow

Php injection 3

III. Some injection techniques, many of which are personal discoveries1. Skills in union selectUNION is used to combine the results of multiple SELECT statements into one result set. Columns listed in the select_expression section of SELECT must be

Differences between global variables and $ GLOBALS [] in PHP

1. Comparison of examplesExample 1: The code is as follows:Copy code $ Var1 = 1;Function test (){Unset ($ GLOBALS ['var1']); }   Test ();Echo $ var1;?> Because $ var1 is deleted, nothing is printed.Example 2: The code is as follows:Copy code

Php + CKFinder solution for garbled Chinese name file uploading

Garbled characters in uploaded Chinese name filesFind the following configuration code in ckfinder/config. php:  The code is as follows:Copy code /*If you have iconv enabled (visit http://php.net/iconv for more information ),You can use this

Exercise caution when comparing the require_once () function to the Directory in php.

Assume that the following three files exist: localhost/demo The code is as follows:Copy code C. phpRequire_once ("a. php ");Require_once ("demo/B. php ");B: demo (); a. phpClass{} B. php's content is interesting, because it has to inherit CLASS

Exercise caution when using php require_once and relative directories

Wwwroot // The absolute path of the website root directory is: F:/wwwroot-- Folder_a // folderFile_a_a.phpFile_a_ B .phpFile_a_c.php-- Folder_ B // folder BFile_ B _a.phpFile_ B _ B .phpFile_ B _c.php-- Index. php*************************************

Compatibility of fgetcsv in php with windows and linux

Set area: Simplified Chinese, UTF-8 encoding The code is as follows:Copy code Setlocale (LC_ALL, 'zh _ CN.UTF-8 ');

Php + jquery + json Chinese garbled text quick and simple solution

The code is as follows:Copy code $ Code = json_encode ($ str );$ Code = preg_replace ("# \ u ([0-9a-f] +) # ie", "iconv ('ucos-2', 'utf-8', pack ('h4 ', '\ 1') ", $ code );?>

Php obtains the value of $ _ SERVER [REQUEST_URI].

Among the many predefined SERVER variables in PHP, $ _ SERVER ["REQUEST_URI"] is frequently used, but this variable is only supported by apache. Therefore, we need a more general method to obtain the value of REQUEST_URI. The code is as

Php json_encode Chinese garbled solution

The code is as follows:Copy code $ Arr = array       ('Name' => 'chia ','Age' => 20);$ Jsonencode = json_encode ($ arr );Echo $ jsonencode;?> The result is as follows:{"Name": null, "Age": 20}Chinese is blank. Why? Let's take a look at it.Let's

Php code for deleting arrays and 2D array values

The method is as follows:$ Arr = array (............) ; // Assume that an array with 10 thousand elements contains repeated elements.$ Arr = array_flip ($ arr); // you can delete duplicate elements.What is going on? Let's take a look at the role of

Total Pages: 12780 1 .... 12260 12261 12262 12263 12264 .... 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.