Convert PHP characters to HTML entities

function D_htmlspecialchars ($string) { if (Is_array ($string)) { foreach ($string as $key => $val) { $string [$key] = D_htmlspecialchars ($val); } } else { $string = Str_replace (' & ', ' ', $string); $string = Str_replace (' "', ' " ',

PHP Filter Dangerous HTML function code

1, delete HTML annotation;2, delete script, link, object, embed, IFRAME, frame, frameset and have on the beginning, including Web page effects: [^;] or expression the label of the attribute;3, delete the annotations in the CSS tutorial (prevent this

A complete PHP Verification code instance program [with demo]

The code is as follows Copy Code login User:Password:Pincode: log_demo.php Code The code is as follows Copy Code Require_once ("log_aux.php");if ($_get[' a '] = = "pin") {Getpinimg ();Exit}if ($

Introduction to implementation examples of AutoLoad in PHP

We usually create a PHP source file for each class when we write a Web application. In order to use these source files, we need to write a large number of include statements (Include,require) at the beginning of each script. In PHP 5, this is no

PHP using the GD library to achieve text image watermark and thumbnail tutorial

We have to use the GD library must first open the GD library, specifically as follows GD Library support for PHP under Windows Find php.ini, open content, find: ; Extension=php_gd2.dll Put the front semicolon ";" Remove, then save, if there is

PHP generates Excel files and prints to the browser

ole

This article describes the PHP spreadsheet_excel_writer and how to generate Excel files.First step, install Spreadsheet_excel_writer because this package uses OLE packages, you may need to install it Perform the following command to perform the

PHP string length calculation strlen and Mb_strlen usage

The common functions for calculating string lengths in PHP are: strlen and Mb_strlen Compare strlen and Mb_strlen 1.strlen PHP Built-in string length function2.mb_strlen is not a PHP core function, you need to be sure to load the Php_mbstring.dll

PHP generates snowflake background verification Code program codes

Verification Code Generation Program The code is as follows Copy Code Session_Start ();Session_register ("Login_check_number");Last night saw the verification code effect on the Chianren, just consider it, using PHP's GD

Create transparent background PNG thumbnail program in PHP

When the PNG thumbnail was generated, the background was black and today a function was written to make up for it. The code is simple, imagealphablending ($thumb, False), and Imagesavealpha ($thumb, true); It is important to save the alpha value of

Add CDATA Tags when PHP generates XML

Put code on to keep the scars, don't take the as a prefix, in fact it can be a label. The code is as follows Copy Code $dom = new DOMDocument ("1.0");Display document in browser as plain textFor readability

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 sso single sign-on implementation code

The code is as follows:Copy code  // Index. php application pageHeader ('content-Type: text/html; charset = utf-8 ');$ Sso_address = 'http: // 2spaoku.com/sso/login.php'; // Your SSO domain name$ Callback_address = 'http: // '. $ _ SERVER ['http _

Php storage routine, stored procedure Getting Started Tutorial

Php tutorialsWhat is a storage routine?A storage routine is a set of SQL statements stored on the database tutorial server. You can run these SQL statement commands by calling a specified name in the query.Why use stored procedures?We all know that

Php Chinese character conversion pinyin and pinyin conversion Chinese character program

The code is as follows:Copy code Function pinyin ($ _ string, $ _ code = 'utf-8 '){ $ _ Datakey = "a | ai | an | ang | ao | ba | bai | ban | bang | bao | bei | ben | beng | bi | bian | biao | bie | bin | bing | bo | bu | ca | cai | can | cang |

Five php methods to generate swf file code

/*The following php flash file generation code is from simple swf file generation to flash animation file generation. Each instance is classic.*/// First enable php extension php_ming$ F = new swffont ('_ sans ');$ T = new swftextfield ();$ T->

Use PHP 5.0 to easily parse XML documents (6)

The following describes how to use the createNode () function to add a product and then display the added result. Hualian Beijing Chang'an Street-No. 9999 supermarket chains 123456789 food11 12.90 This product is good new food12 22.10 food13

PHP source code for sending text messages using ICQ Gateway

//###################################### #####################//// For questions and comments// Roland (alias-=: Vlieg: = -)// Icq #78354631.// Mail: vlieg@atoomnet.net//// NB: This script won't work on free hosting pages, because of the secure mode!

Iconv encoding conversion in php to solve Chinese garbled characters

The code is as follows:Copy code Echo $ str = 'Hi, it's coffee sale! ';Echo ' ';Echo iconv ('gb2312', 'utf-8', $ str); // Encode the string from GB2312 to UTF-8Echo ' ';Echo iconv_substr ($ str, 1, 1, 'utf-8'); // truncate by number of characters

Php utf8 page verification code Picture Chinese garbled characters

  The code is as follows:Copy code Session_start ();// Generate a random numberFor ($ I = 0; $ I $ Rand. = dechex (rand (1, 15 ));}$ _ SESSION ['checkpic '] = $ rand;$ Im = imagecreatetruecolor (, 30); // canvas to create a true color image//

PHP string regular expression replacement function preg_replace

Syntax: mixed preg_replace (mixed pattern, mixed replacement, mixed subject );Returned value: Hybrid DataFunction type: data processingDescription: This function uses the pattern rule to parse and compare the string subject. The string to be

Total Pages: 12780 1 .... 3272 3273 3274 3275 3276 .... 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.