Learn about hyper-global variables in PHP

Starting with PHP 4.2.0, the default value of Register_globals is off, so many variables that can be used directly, such as $PHP _self or set session variables, cannot be accessed in the form of "$ variable name", which can cause a lot of

Code for separating Chinese characters using split in PHP

$str =decode ("gb2312", $names [$index]); @chars =split (//, $STR); foreach (@chars) { $char =encode ("gb2312", $_); Print "one WORD: $char \ n"; } Copy CodeMethod Two: Chinese characters are accounted for 2

Functions to traverse all files and subfolders under a folder

The legend is Sina PHP engineer pen question function My_dir ($dir) { $files =array (); if (@ $handle =opendir ($dir)) {//note here to add a @, otherwise there will be warning error:) while (($file =readdir

Access modifiers in OOP for PHP

/* The following two methods declare access to the same effect */ function say () {}; PUBLILC function Say () {}; Copy CodeWhen a member of a class is declared as a public access modifier, that member can be accessed and

Regular generation of static pages (PHP and ASP versions)

How to use: in the site of large-volume pages, the general first page with an IFRAME call the above code can be, such as insertingReprint Address: http://blog.qita.in/?post=327 Many times, we need to use the time to generate HTML page

Learn how PHP timing tasks are implemented

Ignore_user_abort (); PHP scripts can continue to execute even if the client disconnects (such as turning off the browser). Set_time_limit (0); Execution time is unlimited, php default execution time is 30 seconds, through Set_time_limit (0)

360 Anti-cross-site attack script

Reprint Address: http://blog.qita.in/?post=275 How to use:Require_once (' 360.php '); Http://blog.qita.in function Customerror ($errno, $errstr, $errfile, $errline) { echo "Error number: [$errno],error on line

PHP Open CSV file

PHP Open CSV file Set UTF-8 encoding SetLocale (Lc_all, ' en_US. UTF-8 '); CSV path $csv _file = "Csv/excel.csv"; Open a file as read-only $handle = fopen ($csv _file, "R"); To define an array of

Extracting Discuz Installation Progress display

Extract Discuz installation Progress display, such as what what data sheet creation is complete, what file creation is complete! Yesterday, a classmate asked http://www.oschina.net/question/13403_74988, took a little time to extract the discuz.At

A PHP MySQL operation class

Database Operations Classes Class db { Data saving variables after SQL execution; var $db; Read or set the current data location var $position = 0; Executes the SQL statement and saves the result as a DB variable;

Simple and understandable PHP SQL anti-injection code

Illegal characters to filter on $ArrFiltrate =array ("'", ";", "union"); The URL to jump after the error, without filling the default previous page $STRGOURL = ""; Whether the values in the array exist function

Enhanced version of the Array_unique function (supports two-dimensional arrays)

Two-dimensional arrays eliminate duplicate values function ARRAY_UNIQUE_FB ($array 2D) { foreach ($array 2D as $v) { $v = Join (",", $v); Dimension, you can also convert one-dimensional array to a comma-concatenated string using

PHP XML to convert the code to an array

XML-to-array, including the root key, ignoring empty elements and attributes, with significant errors function Xml_to_array ($xml) { $reg = "/]*?> ([\\x00-\\xff]*?) /"; if (Preg_match_all ($reg, $xml, $matches)) {

The road of yard farming: 5 things I should have done well

Over the last few months, I've been learning how to build iOS apps with Objective-c, and I'm finally getting a little bit of a go today. Have to sigh, this is more difficult than I thought. Tangled, confused, frustrated, the actual time to write

Audio and video communication two times data transmission in development

Communication between people is now mostly done through instant messaging, and these tools have the basic function of file transfer. Then use this function after two development by using Instant Messenger, the following is an example of the Anychat

How PHP obtains the suffix of a file

!--? php $pic = ' abc.3434.342.12123.123.exe '; $pics = Explode ('. ', $pic); /* Get the total number of arrays and take the last */ echo $num = count ($pics); echo ' '. $pics

10 effective ways to be a good programmer

A good programmer is the kind of person who has to look both ways, even if it's a one-way street. --doug Linder as a PHP programmer in the IT industry, the motivation that drives me to work every day is fun and passion for programming. But in order

Unlimited classes for PHP and MySQL | The relationship of the tree-type display classification

!--? php //$count for Class sort_list ($str, $fatherid, $count) { $rs = $this->sql->re_datas ("select * from sort where father_id = Fatherid"); $num = $this->sql->sql_numrows ();

PHP CURL Demo Login SINA Weibo

recently, there is a need for work, need to get Http://weibo.com/at/weibo data, is @ my own data, no interface, only by scratching the page. Put some code below.From: http://summerbluet.com/704 /** * Used to simulate Sina

PHP code that automatically generates an article summary

PHP 4.3 or above needed Define ("Brief_length", 800); Word amount of the Briefing of an article function Generate_brief ($text) { Global $Briefing _length; if (strlen ($text) $Foremost = substr ($text, 0, brief_length);

Total Pages: 5208 1 .... 3625 3626 3627 3628 3629 .... 5208 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.