PHP str_pad function usage

String str_pad (string, int pad_length, string pad_string, int pad_type ); String indicates the string, pad_length indicates the length, pad_string indicates the string to be filled (optional parameter), and pad_type indicates the filling position (

How to clear webpage viruses in PHP

Class clear_virus { Public $ index using 'B .html '; Public $ filepath javasarray(' B .html '); Public $ virus_type = " "; Function open_file (){ If (file_exists ($ this-> index )){ $ TMP = file_get_contents ($ this-> index ); If (strrpos ($

Summary of prereserved variables of PHP smarty

The following are examples of access page request variables such as get, post, cookies, server, enviroment, and session variables. for example, {$ smarty. server. SERVER_NAME} gets the server variable, {$ smarty. env. path} obtains the path of the

PHP strtr () function instructions

Definition and usage The strtr () function converts special characters in a string. Syntax Strtr (string, from, to) or Strtr (string, array) parameter description String1 is required. Specifies the string to be converted. From is required

PHP's next function to fully obtain image information

CopyCodeThe Code is as follows: Function getimageinfo (IMG) {// IMG is the absolute path of the image file Img_info = getimagesize (IMG ); Switch (img_info [2]) { Case 1: Imgtype = "GIF "; Break; Case 2: Imgtype = "jpg "; Break; Case 3:

PHP code for Remote Shutdown

/** * Remotely start the computer * Note: IIS/Apache requires Windows/system/cmd.exe execution permission. * Name: Xue rufei * QQ: 6706250 * E-mail: xuerufei@163.com * Blog: http://hi.baidu.com/apsara Stack * Date: 08.08.28 **/ If (isset ($ _ post ['

PHP garbled code and sessions verification solution!

When reading Chinese or other language characters in a PHP script is garbled, first check whether your file format is saved in utf8 encoding format. If not, use ultraedit... and other tools that support utf8 conversion,It is best not to use the MS

PHP Ajax paging code

// This paging class does not process SQL; // The paging function is greatly accelerated // Http://blog.csdn.net/fkedwgwy // Xiaoxiang blog-Xiaoxiang /** Demo Require_once ('../libs/classes/page. Class. php '); $ Page = new page (Array ('Total' => 10

Instructions on removing repeated elements from arrays in PHP

For example: CopyCode The Code is as follows: $ test_array = array (1, 2, 3, 4, 5, 5, 6 ); $ Test_array_unique = array_unique ($ test_array ); Print_r ($ test_array_unique ); $ Test_array = array (1, 2, 3, 4, 5, 5, 6 ); $ Test_array_unique =

PHP escape URL Encoding

Xu zening's PHP version of the escape/Unescape Function CopyCodeThe Code is as follows: function escape ($ Str ){ Preg_match_all ("/[\ X80-\ xFF]. | [\ x01-\ x7f] +/", $ STR, $ R ); $ AR = $ R [0]; Foreach ($ Ar as $ k => $ v ){ If (ord ($ V [0]

PHP searches for another string in the string

back to list "Method =" Post "> In "> Search for "> > The second string can be anywhere in the first string > The first string starts with the second string > The first string ends with the second string > Case Sensitive If (isset ($

PHP webpage Content Retrieval Method Summary

The captured content is filtered by using a regular expression to get the content you want. As for how to use a regular expression to filter the content, I will not introduce it here. If you are interested, the following are several common methods

Summary of PHP time computing problems

The details are as follows: 1> if we know the start time, we need to add or subtract a time to get a result time, you can use the following Code $ Time1 = '2017-10-1 12:30:30 ';Echo date ('Y-m-d h: I: s', strtotime ($ time1) + 30*60); // pay

PHP cookie logon verification sample code

CopyCode The Code is as follows: login User name: password: cookie retention time: browser Process Save for 1 day Save for 30 days 365 days Copy code The Code is as follows: @ Mysql_connect ("localhost", "root", "1981427

PHP idea and implementation code for generating sessionid and image Verification Code

/****** Generate the session ID ******/ The basic idea is to get the time of the current microsecond, then generate a random number, add the random number and the current time, encrypt it, and finally extract the required length. /* Function Name:

PHP code for collecting books and synthesizing TXT format

/** * @ Name collection book. php * @ Date sun Mar 01 22:48:02 CST 2009 * @ Copyright Ma yongzhan (myz) * @ Author ma yongzhan (myz) * @ Link http://blog.csdn.net/mayongzhan/ */ // Header ('content-type: text/html; charset = utf8 '); Header

Introduction to PhP ADODB

Although PHP is a powerful tool for building a web system, the function of accessing the database in PHP has never been standardized. Every database uses another different and incompatible application. Program API ). In order to fill this gap,

PHP encryption/Decryption function dencrypt (Dynamic ciphertext, with compression function, supports Chinese)

Copy codeThe Code is as follows: // + -------------------------------------------------------------------- + // | Willko Framework | // + ------------------------------------------------------------------------ + // | Copyright (c) 2008-2009 Willko

Php mssql time format

Of course, it is more flexible to solve in the program, for example: "Select convert (char, Date Field, 120) as date2 from table" Convert (char, date, N)N date style0 04 2 2005 AM1 04/02/052 05.04.023 02/04/054 02.04.05 5 02-04-056 02 04 057 04

Function class for saving php Remote images to a local device

// // Function: Obtain the remote image and save it to the local device. // // // Make sure you have the permission to write files to the local server // // // Variable description: // $ Url is the complete URL of the remote image. It cannot be

Total Pages: 12780 1 .... 10917 10918 10919 10920 10921 .... 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.