How to separate full and half angles to avoid garbled characters

Function ChgTitle ($ title){$ Length = 46;If (strlen ($ title)> $ length ){$ Temp = 0;For ($ I = 0; $ I If (ord ($ title [$ I])> 128)$ Temp ++;If ($ temp % 2 = 0)$ Title = substr ($ title, 0, $ length )."...";Else$ Title = substr ($ title, 0, $

Php counter Program

1) text counter$ Countfile = "/count.txt"; // sets the file for saving dataIf (! File_exists ($ countfile) {// checks whether the file exists.Exec ("echo 0> $ countfile ");}$ Fp = fopen ($ countfile, "rw ");$ Length = filesize ($ countfile );$ Num =

Alternative usage of classes-Data encapsulation

Alternative usage of classes-Data encapsulationGenerally, if you use classname: property, you cannot access the attributes of the class, but you can use classname: method () to use the class method. Similarly, you cannot use objectname-> property to

Text Data paging in php (Message book paging)

Many pages are introduced in mysq, but few pages are introduced in the format of text data tables. Here I will briefly refer to pages.This article mainly introduces the following paging ideas:1. Paging of the message book2. Flip pages of text forums-

The function implemented by PHP is to display 8 base color bands

Because PHP's true color table parameters can only support 256, In order to display 8 colors or more ribbons, I used the parameter transfer method. The specific implementation code is as follows:1. Program for generating ribbon graphicsTransition.

Advantages of PHP in Web Development

In the eyes of most WEB developers, ASP and JSP are regarded as leaders, while PHP is regarded as a weak "struggling ", in other words, it is a language used by people who are devalued as the remainder of the industry and is not worthy of

Use PHP to call Oracle stored procedures

PHP programs can access the database and use stored procedures. Some people think that the stored procedure is easy to maintain.However, the wise man sees wisdom. On this issue, I think that using stored procedures means that DBA and developers must

Ten days to learn php

Objective: To create a paging display The key is to use the limit in the SQL statement to limit the number of records displayed from several to several. We need a variable $ page for recording the current page, and the total number of records $

PHP uses COM objects to Access SQLServer and Access

PHP4.0.6 or above can access COM and DCOM objects on the Win32 platform. Use ASP to access SQLServer. Of course, you can also use mssql functions. If it is an ASP Coder, you will think the following code is very familiar and used to ---- No other,

PHP uses SAX to parse XML implementation code and Problem Analysis

Copy codeThe Code is as follows:$ G_books = array ();$ G_elem = null;Function startElement ($ parser, $ name, $ attrs){Global $ g_books, $ g_elem;If ($ name = 'book') $ g_books [] = array ();$ G_elem = $ name;}Function endElement ($ parser, $

Php logging implementation code

Copy codeThe Code is as follows:$ Ss_log_level = 0;$ Ss_log_filename =/tmp/ss-log;$ Ss_log_levels = array (NONE => 0,ERROR => 1,INFO => 2,DEBUG => 3);// Set the Log LevelFunction ss_log_set_level ($ level = ERROR ){Global $ ss_log_level;$

PHP header Function Analysis

In php, the header () function is very useful, especially when ajax is used, it will help you solve some unexpected problems. The following is a detailed description of the header. Hope to be helpful to phperCopy codeThe Code is as follows:// Fix 404

PHP mixed string truncation Function Code

Copy codeThe Code is as follows:Function get_word ($ string, $ length, $ dot = '..', $ charset = 'gbk '){If (strlen ($ string) Return $ string;}$ String = str_replace (array ('','', '&', '"', ''), array ('','', '&', '"', ''), $ string );$ Strcut = ''

Seven super practical PHP code snippets

1. Super simple page CacheIf your project is not based on a CMS system or framework, creating a simple cache system will be very practical. The following code is very simple, but it can solve problems for small websites.Copy codeThe Code is as

Using explode in php to find whether a character exists

This method can also be used to determine whether the separator is available. For example:Copy codeThe Code is as follows:If ($ _ MODULE [tg1_tjly]) {$ Tg1_tjly = explode ("|", $ _ MODULE [tg1_tjly]);If (count ($ tg1_tjly)> 1) {// here, when the

PHP write sample code of Yang Hui triangle

Copy codeThe Code is as follows:// Yang Hui triangleFor ($ I = 6; $ I> = 0; $ I --){For ($ j = $ I; $ j {If ($ j {Echo " a ";} Else{Echo " ";}}}?> PHP print Yang Hui triangle customCopy codeThe Code is as follows: ">Level of the input Yang Hui

PHP implementation code for reading webpage files (fopen, curl, etc)

1. fopen implementation code:Copy codeThe Code is as follows:$ Handle = fopen ("http://www.example.com/", "rb ");$ Contents = "";While (! Feof ($ handle )){$ Contents. = fread ($ handle, 8192 );}Fclose ($ handle );?> Copy codeThe Code is as follows:/

Php judges that the input does not exceed the length range of the mysql varchar Field

However, in UTF-8 encoding, a Chinese character occupies three characters, for example, the string $ str = "Hello !!";If you use the strlen function to judge that the length is 11, which is more than the length of varchar, but it is actually not

10 tips on PHP array Operations

1. add elements to arrayPhp is a weak language. Therefore, you do not need to declare the length for the php array like the C language. The process of adding elements to it is also a process of declaration and initialization.Copy codeThe Code is as

Practical PHP member permission control implementation principle analysis

My general permission system is designed to avoid code modification when changing permissions. It is from the chinaunix Forum. Let's go and check it out today. I hope to help you and improve bkJia.Copy codeThe Code is as follows:/** Access Table

Total Pages: 12780 1 .... 12751 12752 12753 12754 12755 .... 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.