PHP file Action Instance Code _php instance

Send a simple example first Copy Code code as follows: if (!is_dir (' txt '))//Determine if TXT is a folder directory { mkdir (' txt ');//Create a folder directory named txt $open =fopen (' txt/in.txt ', ' w+ ');//Open file in

A simple Web page password login PHP code _php instance

Copy Code code as follows: $password = "1234"; This is the code. $p = ""; if (Isset ($_cookie["Isview"]) and $_cookie["Isview"] = = $password) { $isview = true; }else{ if (Isset ($_post["pwd"])) { if ($_post["pwd"] = = $password) {

Linux Php-cgi.exe takes CPU 100% of a trip to the barrier _linux

First of all, the structure of our website, because the current site traffic is not very large, but due to the recent company website to promote, so the site from a single switch into the front-end with Nginx do load balancing, drive two Web servers,

The use _php base of Get variable in PHP

Http_get_vars is saved with a Get variable since PHP4.1.0, and the get variables are mainly derived from the following methods For example, a URL that uses the method of a form to obtain information about the server for instance, a get way. So all

A section of PHP encryption decryption Code _php Foundation

$key = "This is supposed to be a secret key!!!"; function keyed ($txt, $encrypt _key) { $encrypt _key = MD5 ($encrypt _key); $ctr = 0; $tmp = ""; for ($i =0; $i { if ($ctr ==strlen ($encrypt _key)) $ctr = 0; $tmp. = substr ($txt, $i, 1) ^ substr

Simple usage examples of preg_replace_callback functions in PHP _php tips

This article illustrates the use of Preg_replace_callback functions in PHP. Share to everyone for your reference, specific as follows: Mixed Preg_replace_callback (mixed pattern, callback callback, mixed subject [, int limit]) The behavior of this

Some common PHP functions _php Foundation

1. Generating random String functions function Random ($length) { $hash = '; $chars = ' abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz '; $max = strlen ($chars)-1; Mt_srand (Double) microtime () * 1000000); for ($i = 0; $i $hash. = $

PHP Convert text box content to HTML format _php tips

This article is an example of how PHP transforms text box content into HTML format. Share to everyone for your reference, specific as follows: Sometimes we're going to use the HTML format for the content that you enter in a multiline text box to

Integration of the previous PHP database connection class ~ ~ made a page-like!_php Foundation

I do not know whether to learn PHP has a future ~ hey more write more boring The start of Class Createdb//Classes { var $db = "localhost";//database address; var $dbname = "root";//user name; var $dbpwd = "";//password; var $dbtable =

The vs2005 diagram _php Techniques of PHP development tools

Why would you think of using vs2005? One is to be inspired by vs development. NET application, or asp.net time ... I've always missed it. Second, VS is a very comprehensive editor, even pictures can directly open the editor, for similar to my work

PHP Novice on the road (10) _php Foundation

Building a simple interactive website (vi) 9. Simple Banner Dynamic replacement I do not know if you have found the major sites on the banner ads banner, each time we visit these sites, will see a different advertising icon, or if you refresh the

PHP Notes: Php function range () round () and list () use Instructions _php instance

A >> The range () function quickly creates an array of simple methods that populate the array with an integer value of low to high range, and the function returns an array containing all the integers in the secondary range. The form is as follows

PHP variables, constants learning notes _php Tips

To assign a value to a variable's pass address In PHP 3, variables are always assigned values. PHP 4 provides another way to assign a value to a variable: to send an address assignment. Using a pass address assignment, simply appends a (&) symbol

PHP Novice on the road (vii) _php Foundation

Building a simple interactive website (iii) 6. Password verification Maybe you want to put your photo album on your website and just want to show your intimate friends that you need a password verification program. 6.1 Based on HTTP

How to manipulate the INI configuration file in PHP _php instance

PHP Operation INI Config file Copy Code code as follows: Write INI file function Write_ini_file ($assoc _arr, $path, $has _sections=false) { $content = ""; if ($has _sections) { foreach ($assoc _arr as $key => $elem) { $content. =

PHP implementation route map to specified controller _php tips

Customize the routing function, specify the URL to PathInfo, and upgrade the script before simpleloader.php $v) {if ($k ==0) continue; $_server[' path_info '].= '/'. $v; }}//Routing mode public static function router ($rules) {if isset

Teach you to hide PHP version information in header _php tips

Objective In PHP rendered page header information, will contain the version number of PHP information, such as: x-powered-by:php/5.3.3, this is somewhat unsafe, some hackers may be scanning the way to bulk search for a lower version of the PHP

How to implement batch modification of file names in PHP _php tips

The example in this article describes how PHP implements batch modification of file names. Share to everyone for your reference, specific as follows: "; for ($i =0; $i "; $file =basename ($file _name); echo $file. " "; $dir _arr_

PHP uses header function to download various file _php instances

This example for you to share the PHP header function download file implementation code for your reference, the specific content as follows http://www.php.net/manual/en/function.readfile.php 404 File not found!"); }//Gather relevent info

Laravel the best way to split routing files (routes.php) _php instances

Objective Laravel's routing is powerful, the default is defined in the routes.php file, as the project grows larger, we need to define more and more routes, imagine if hundreds of thousands of routes are defined in a file, how to maintain? There

Total Pages: 12780 1 .... 2858 2859 2860 2861 2862 .... 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.