A good php universal anti-injection program-php Tutorial

A good php universal anti-injection program Function jk1986_checksql () { $ Bad_str = "and | select | update | '| delete | insert | *"; $ Bad_Array = explode ("|", $ bad_str ); /** Filter

Differences between the array sorting function array_multisort and uasort in php

Differences between the array sorting function array_multisort and uasort in php Function my_sort ($ a, $ B) { If ($ a = $ B) return 0; Return ($ a> $ B )? -1: 1; } $ People = array ("Swanson"

Two methods for php to automatically generate a new password

Two methods for php to automatically generate a new password /* * Php automatically generates a new password user-defined function Applicable environment: PHP5.2.x/mysql 5.0.x Code author: xujiajay

Php automatically generates the TXT file code

Php automatically generates the TXT file code $ Ua = $ _ SERVER ["HTTP_USER_AGENT"]; $ Filename = "Chinese file name .txt "; $ Encoded_filename = urlencode ($ filename ); $ Encoded_filename =

A simple example of generating a word file using php

A simple example of generating a word file using php /** Php generates word files Link: bbs.it-home.org */ $ Word = new COM ("word. application") or die ("The Word program cannot be started!

Php array sorting method sharing (bubble sorting, select sorting)

Php array sorting method sharing (bubble sorting, select sorting) Function maoPao ($ arr, $ style) // The default value is passed, not the address. If you add an ampersands (&) before $ arr, it points to the same

Php array function array_multisort () usage

Php array function array_multisort () usage $ Arr1 = array ('10', 11,100,100, 'A '); $ Arr2 = array (1, 2, 3, '2', 5 ); Array_multisort ($ arr1, $ arr2 ); ?> Result: $ arr1 Array ([0] => 10 [1] =>

Example of generating word in php

Example of generating word in php // Generate word Header ("Content-Type: application/msword "); Header ("Content-Disposition: attachment; filename = \" file.doc \""); ?>

Php class for reading xml

Php class for reading xml #------------------------------------------ # # XML Library, by Keith Devens, version 1.2b # Http://keithdevens.com/software/phpxml # # This code is Open

Php can be used to obtain the real IP address of the Internet.

Php can be used to obtain the real IP address of the Internet. Function get_onlineip (){ $ Ch = curl_init ('http: // www.ip138.com/ip2city.asp '); Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true ); $ A

Usage of phpauto_prepend_file and auto_append_file

Usage of phpauto_prepend_file and auto_append_file Auto_prepend_file = "c:/Program Files/include/header. php" Auto_append_file = "c:/Program Files/include/footer. php" In unix: Auto_prepend_file = "

Code for converting php xml to an array

Code for converting php xml to an array // Xml to array, including the root key, ignore empty elements and attributes, there are still major errors Function xml_to_array ($ xml) { $ Reg = "/] *?>

Phpfile_get_contents function code for capturing page information

Phpfile_get_contents function code for capturing page information $ Url = "http://bbs.55bbs.com "; $ Contents = @ file_get_contents ($ url ); // Preg_match_all ("/(.*?) /is ", $ contents, $ content );

Four Chinese character string truncation functions in php

Four Chinese character string truncation functions in php // Truncate a Chinese string Function mysubstr ($ str, $ start, $ len ){ $ Tmpstr = ""; $ Strlen = $ start + $ len; For ($ I = 0; $ I

Php-written class for filtering and retaining attributes

Php-written class for filtering and retaining attributes /** @ Set and retain the attribute class @ Class cleanHtml @ Link: bbs.it-home.org @ Date: 2013/2/28 */ Function reg_escape ($

Phpfile_get_contents function usage problems

Phpfile_get_contents function usage problems Array (11 ){ [0] => String (15) "HTTP/1.1 200 OK" [1] => String (35) "Content-Type: text/html; charset = gbk" [2] => String (17) "Connection: close"

DATE_FORMAT, FROM_UNIXTIME, UNIX_TIME

DATE_FORMAT, FROM_UNIXTIME, UNIX_TIME DATE_FORMAT (NOW (), '% B % d % Y % h: % I % p ') DATE_FORMAT (NOW (), '% m-% d-% Y ') DATE_FORMAT (NOW (), '% d % B % Y ') DATE_FORMAT (NOW (), '% d % B % Y % T: % f ')

Phpsession verification code inconsistency Total Display last verification code solution

Phpsession verification code inconsistency Total Display last verification code solution $ (". Login"). live ('click', function (){ Var username = $ (". input_user"). val (); Var password = $ (". input_ps").

Php encryption and decryption functions (Chinese characters not supported)

Php encryption and decryption functions (Chinese characters not supported) /* @ Name: PHP encryption/decryption @ Link: bbs.it-home.org @ Date: 2013/2/28 */ Function phpencode ($ code ){

Php function for converting RMB into uppercase Chinese

Php function for converting RMB into uppercase Chinese /** Convert RMB amount to Chinese capital Link: bbs.it-home.org Date: 2013-2-28 */ Function cny ($ ns ){ Static $ cnums =

Total Pages: 12780 1 .... 8646 8647 8648 8649 8650 .... 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.