Example code for PHP to browse the contents of a file in a directory

/** * Browse files in directory * Edit bbs.it-home.org */ $dir = DirName (__file__); $open _dir = Opendir ($dir); echo " echo " while ($file = Readdir ($open _dir)) { echo " echo "

PHP MySQL code example to implement user login function

This article introduces, PHP and MySQL combination, to achieve user login function of a piece of code, suitable for Beginners friends reference, used to study the implementation of PHP user login, or a bit of reference to the meaning.Then the last

Examples of using PHP class constants

Class foo{ Const Con_var= "The value of the constant property cannot be modified"; Public Function method_a () { Echo (Self::con_var); } } Echo (Foo::con_var); $myFoo =new Foo (); Echo

MySQL problem: Too Many connections solution

[Mysqld] Port = 3306 Socket =/tmp/mysql.sock Skip-locking Key_buffer = 160M Max_allowed_packet = 1M Table_cache = 64 Sort_buffer_size = 512K Net_buffer_length = 8K Read_buffer_size = 256K

Simple code examples for PHP counters

!--? php /* * Example 1, text file record Data * Edit bbs.it-home.org */ $counter =1; if (file_exists ("Mycounter.txt")) { $fp =fopen ("Mycounter.txt", "R");

Reversible cryptographic function of Ucenter Authcode

Reversible cryptographic functions function Authcode ($string, $operation = ' DECODE ', $key = ", $expiry = 0) { $ckey _length = 4; Random key length value 0-32; Join with the secret key, you can make ciphertext no rules, even if the

PHP implementation of registered login complete program (using MySQL database)

This article introduces, with the MySQL database with PHP, the implementation of a registered login complete code, there is a need for friends, refer to it.To achieve user registration login function, a total of 8 pages: 1,login.php landing Page

Discussion: Several ways to crawl pages in PHP

$url = ' http://t.qq.com '; $lines _array=file ($url); $lines _string=implode (', $lines _array); Echo htmlspecialchars ($lines _string); Copy Code2. The file_get_contents () function uses file_get_contents and fopen

A case of PHP reversible cryptographic function code

Encrypt the data and write it into a cookie. $cookie _data = $this, Encrypt ("Nowamagic", $data); $cookie = Array ( ' Name ' = ' $data ', ' Value ' = $cookie _data, ' Expire ' = $user _expire, ' Domain ' = ', '

Php method for judging and removing duplicate data in arrays

if (count ($array)! = Count (Array_unique ($array))) { Echo ' The array has duplicate values '; } ?> Copy CodePHP removes duplicate array data $input = Array ("A" = "green", "" "," Red "

Deep understanding of the difference between Ob_flush and flush in PHP

Ob_start (); echo ' 1 '; Ob_flush ();//output PHP cache and Refresh echo ' 2 '; Ob_flush ();//output PHP cache and Refresh $CC = Ob_get_contents (); Ob_end_clean (); Var_dump ($CC); ?>

A small example of a PHP scheduled task

When 0 o'clock, the scheduled task is closed return 1; ?> Copy Code2,jbxue.php Ignore_user_abort ();//switch off the browser, PHP script can continue to execute. Set_time_limit (0);//

PHP Array Merging: + operator, Array_merge, array_merge_recursive difference analysis

$a = Array ( ' A ', ); $b = Array ( ' U ', ); $c = $a + $b; Var_dump ($c); Copy CodeOutput: $a = Array ( 66=> ' A ', ); $b = Array ( 60=

How to change the php.ini load path under Windows

This article describes the method of changing the load path of the php.ini file under the Windows environment, with the need for friends, refer to the next bar.Under Windows, change the php.ini load path, as long as you add a piece of code to the

PHP parsing JSON and XML data implementation code

$json _string= ' {"id": 1, "name": "foo", "email": "foo@jbxue.com", "Interest": ["WordPress", "PHP"]} '; $obj =json_decode ($json _string); Echo $obj->name; Prints Foo Echo $obj->interest[1]; Prints PHP Copy Code2,php

PHP intercepts the Chinese function utf_substr

ord

$tmp = Preg_replace ('/[-Calls]/u ', ' ', ' Hello, who am I? 123abc '); /U is UTF-8 Copy CodeCode 1,php intercepts UTF-8 strings, solves half-character problems /*** * PHP

Knowledge of security precautions in PHP programming

Register_global = Off MAGIC_QUOTES_GPC = Off Display_error = Off Log_error = On # allow_url_fopen = Off expose_php = Off Open_basedir = Safe_mode = On Disable_function =

Summary of some methods of PHP regular expressions

if (Preg_match ("/^\d*$/", $fgid)) echo (' is number '); else echo (' not a number '), or Echo (' is number ') with function [Code]if (Is_numeric ($fgid)); else echo (' not a number '); Copy CodeThe difference is

php Simple parameter Filter code learning

/** * Parameter Filter code * Edit bbs.it-home.org */ if (@get_magic_quotes_gpc ()) { $_get = sec ($_get); $_post = sec ($_post); $_cookie = sec ($_cookie); $_files = sec ($_files); }

A comprehensive analysis of the reasons for the slow speed of PHP website

This article analyzes the reason that the Php+mysql website opens slowly, has the need friend, may the reference, improves, in order to improve the website access speed.1, the database table structure is unreasonable when you create a MySQL database

Total Pages: 5208 1 .... 3628 3629 3630 3631 3632 .... 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.