PHP custom Dump_var function to facilitate its own development

For example, the indentation of the relationship, each write in front plus echo "", in fact, this is very uncomfortable! There are internal var_dump (), anyway, the effect is not ideal, so I wrote this, add this function in the configuration file,

PHP Str_pad to achieve the number of card number of insufficient digits automatically fill 0

The Str_pad () function fills the string to the specified length. Grammar Str_pad (String,length,pad_string,pad_type) Parameters Description String Necessary. Specify the string to be populated. Length

PHP Intercept String Topic

PHP Intercept String Topic Author: unknown Source: Unknown 1. Intercept GB2312 Chinese string Intercepting Chinese strings function Mysubstr ($str, $start, $len) { $tmpstr = ""; $strlen = $start + $len; for ($i = 0; $i if (Ord (substr ($str, $i, 1))

PHP's Cache class

It was a great pleasure to find it in phpx.com yesterday. Thank dxf218 I fixed a little bit of the problem. /* * FileName:cache.inc.php * Link: [Url]http://blog.111cn.net/dxflingxing/[/url] * author:dxflingxing * date:2006-5-9 * Last Modified:2006-5

PHP Verify URL is correct

It's actually a function that doesn't work because the domain name is now very slippery. Many domain names as long as registered, even if not used will be the default point to a domain name provider URL. So even if you go through it, you're going to

PHP Batch generation thumbnail

This file can be used to automatically create thumbnails of all JPG images in the directory, and to run them under the picture directory.Disadvantages: Long width of the picture will be stretched deformation, can not be intelligent cutting, need

Example of memcached caching application in PHP

1. Add Expansion pack The code is as follows Copy Code Php_memcache.dll 2. Add in PHP.ini The code is as follows Copy Code Extension=php_memcache.dll 3. The procedure

Php generates ip addresses on images

The code is as follows:Copy code $ Img = imagecreate (180,50 );$ Ip = $ _ server ['remote _ addr '];Imagecolortransparent ($ img, $ bgcolor );$ Bgcolor = imagecolorallocate ($ img, 0x2c, 0x6d, 0xaf); // background color$ Shadow =

Php reads image files in the directory

The code is as follows:Copy code $ Directory = 'Gallery ';$ Allowed_types = array ('jpg ', 'jpeg', 'GIF', 'PNG ');$ File_parts = array ();$ Ext = '';$ Title = '';$ I = 0;$ Dir_handle = @ opendir ($ directory) or die ("there is an error with your

Php uploads an image and generates a specified size chart proportionally

Image scaling functionParameter description: The code is as follows:Copy code $ Srcfile source image address;$ Dir New graph Directory$ Thumbwidth: zoom out the maximum graph width$ Thumbheitht zoom in to the maximum image height$ Ratio by

Php scaling down images

The code is as follows:Copy code Function imageresize2 ($ width, $ height, $ targetw, $ targeth){$ Percentage = 1;If ($ width> $ targetw) | ($ height> $ targeth ))  {$ Width_diff = $ width-$ targetw;$ Height_diff = $ height-$ targeth; If ($ width_

Php solves the problem of displaying only one space in multiple input spaces.

The code is as follows:Copy code If ($ _ POST){$ Txt = $ _ POST ['txt '];Echo $ txt. ' ';Echo str_replace (chr (32), '& nbsp;', $ txt );}?>

Php Cache design

$ Cahetime = 2; // Set the Expiration Time$ Cahefile = "cahe.txt"; // read/write textIf (file_exists ($ cahefile) & time ()-$ cahetime  Echo file_get_contents ($ cahefile ); }Else {File_put_contents ($ cahefile, date ("y-m-d H: I: s", time ())); }?>

Php functions to solve json Chinese garbled characters

The php Tutorial comes with json_encode to process json data, so they do not support Chinese. Let's take a look at the example below.Echo json_encode (array (123213, 'China '));{"Platformid": "123213", "userid": "1023", "username": "u00b7u00f0u00b5u0

Php memcache installation and precautions

Install php Tutorial extension: Steps for memcache in windows1. Download php extension dll: http://downloads.php.net/pierre/2. Put. dll under the extension directory of php, which is generally in the ext folder of the php directory.3. Modify php.

Php Regular Expression Learning Manual (1/5)

Full manual on regular expressions in php tutorialsPrefaceRegular expressions are cumbersome, but they are powerful. The application after learning will give you an absolute sense of accomplishment in addition to improving your efficiency. As long

Php Chinese Directory include troubleshooting

Php Tutorial Chinese Directory include error solution accessInclude_path = '.; c: php5pear' errorWarning: unknown: failed to open stream: no such file or directory in unknown on line 0Fatal error: unknown: failed opening required

Php file_exists invalid solution

Method 1: According to the official manual, if the safe mode settings of the php Tutorial are too harsh, the following situation may occur: Although the file actually exists, it is also reported that the file does not exist.Because the php. ini

Php conversion form textarea line break code

After my test form textarea line break, it is rn in windows and n in linux (this is not realTest). In addition, in win, r and n have the line feed function.Table 6-1. Escape charactersSequenceDescriptionNLine feed (lf or ascii characters 0 × 0a (10 )

Total Pages: 12780 1 .... 9420 9421 9422 9423 9424 .... 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.