PHP Gets the parent directory method of the current file summary _php tips

First, get the length of the folder that contains the current file, and then use substr to intercept the length: Copy Code code as follows: $dirName = Str_replace ("\", "/", DirName (__file__)); $dirNameLength = strlen ($dirName);

PHP Picture Add watermark Example _php tips

Picture Add watermark I believe all friends know, today we look at a section of PHP image add watermark example, I hope the article can help friends. The above is the entire content of this article, I hope to help you learn, but also

PHP Simple Calendar Implementation method _php tips

This article describes the PHP simple calendar implementation method. Share to everyone for your reference, specific as follows: The screenshot of the running effect is as follows: The specific code is as follows: Day one two three

Analysis of socket connection and read-write data timeout problem in PHP _php tips

This article illustrates the problem of timeout of socket connection and read-write data in PHP. Share to everyone for your reference, specific as follows: Although the Fsockopen () method in PHP has timeout parameters for connecting sockets, there

PHP spl_autoload_register () function usage examples to explain _php skills

This article analyzes the usage of spl_autoload_register () function in PHP. Share to everyone for your reference, specific as follows: Let's look at another function before you know this function: __autoload. First, __autoload This is an auto

Using PHP to implement a batch query to clear a word back door code _php tips

Always forget a sentence put in which file, directly all kill ... Copy Code code as follows: if (!isset ($dir) or empty ($dir)) { $dir =str_replace (' \ \ ', '/', dirname (__file__)); echo "". $dir. " "; } else { $dir =$_get[' dir ']

PHP random output of famous quotes code _php instance

So how does the function of this random celebrity quote be achieved? In fact, it is very simple, only need a string variable, which put all the random to show the famous quotes, and then use the explode function to decompose the number of groups,

PHP string Interception Chinese interception 2, single byte interception mode _php technique

Chinese interception 2, single byte interception mode function Cn_substr ($str, $slen, $STARTDD =0) { $restr = ""; $c = ""; $str _len = strlen ($STR); if ($str _len if ($str _len $ENDDD = $STARTDD + $slen-1; for ($i =0; $i { if ($STARTDD ==0) $restr.

The collection _php techniques of some common functions in PHP

/* Obtain Client IP address * * function GetIP () { if (getenv ("Http_client_ip") && strcasecmp (getenv ("Http_client_ip"), "Unknown")) { $ip = getenv ("Http_client_ip"); } else if (getenv ("Http_x_forwarded_for") && strcasecmp (getenv

Simple PHP image upload program _php tips

First type: PHP section Copy Code code as follows: if ($_files[' file '] [' ERROR '] > 0) { Echo '!problem: '; Switch ($_files[' file '] [' ERROR ']) { Case 1:echo ' file size exceeds server limit '; Break Case 2:echo ' file is

PHP variables and some of the applicable methods _php tips

Variables: $_server, used in PHP 4.1.0 and later versions. Previous versions, using the $HTTP _server_vars Variables: $_env, used in PHP 4.1.0 and later versions. Previous versions, using the $HTTP _env_vars Variables: $_cookie, used in PHP 4.1.0

PHP Image Verification Code code _php tips

Copy Code code as follows: File Header ... Header ("Content-type:image/png"); Create a true Color white paper $im = @imagecreatetruecolor (die) or ("Create image Failed"); Get background color $background _color = imagecolorallocate ($im, 2

A method to import massive data into database based on PHP reading TXT file _php example

There is a TXT file, containing 100,000 records, the format is as follows: Column 1 column 2 column 3 column 4 column 5A 00003131 0 0 adductive#1 adducting#1 adducent#1A 00003356 0 0 nascent#1A 00003553 0 0 emerging#2 emergent#2A 00003700 0.25 0

PHP 5.0 Object Model Deep Exploration of object replication _php techniques

By default, the __clone method creates an object that has the same properties and methods as the original object. If you want to change the default content during cloning, you will overwrite (attribute or method) in the __clone. A cloned method can

PHP 5.0 Object Model depth exploration of attributes and methods _php skills

You can use->, and if an object's properties contain an object, you can get the properties of the inner object using two-> operators. You can even place these expressions with a string of double references. In the following example, the property

PHP simple static page generation process _php Tips

First, the use of related technical keywords: PHP, Apache, Mod_rewrite (rewritecond,rewriterule) address rewrite, OB series function buffering File_put_contents Generate HTML Second, the process: the user issued a request url?id=x, to determine

PHP implementation of the Site Directory Scan Index tool _php instance

The code is very simple, here is not much nonsense, this code to a Netizen's contribution, tested available $zs 404) {$log = $name. ' *yes '; else {$log = $name. ' No '; File_put_contents ($file _name, $log. Php_eol, File_append); Write

On the difference between UrlEncode and Rawurlencode in PHP _php example

Some time ago said that they encountered a "URL plus error" bug, the reason for this bug is that they use the UrlEncode function in the URL, the function will be converted to a plus space, which causes the URL parsing error, and the space only

PHP reflection and sample code _php instance

Recently looking at Java programming ideas, see the chapter of type information, the information of class and the concept of reflection. By the way warm up PHP reflection. The manual says: "PHP 5 has a complete reflection API that adds the ability

SMS Public Number Development text message automatically reply PHP code _php instance

This example for you to share the PHP micro-letter Text message automatically reply code, for your reference, the specific content as follows 1.PHP Sample code DownloadDownload Address 1:http://xiazai.jb51.net/201608/yuanma/phpwx (jb51.net).

Total Pages: 12780 1 .... 4125 4126 4127 4128 4129 .... 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.