PHP commonly used to obtain apache information function

* / $ version = apache_get_version (); // Obtain the apache version and assign it to the variable echo "$ version"; // Output the result $ server_ip = apache_getenv ("...

php mysql_connect and mysql_pconnect achieve with a detailed description

In the php tutorial to connect mysql tutorial Database tutorial There are two if there are mysql_connect and mysql_pconnect, one is a soft connection, one is continuous connection, the difference between the two is that when the page browsing automatically closes the mysql connection page has been opened mysql_pconnect If you do not close Always connected. * / $ hostname = "localhost"; & nbsp; ...

php odbc_connect () function description and example code

Connect to odbc The odbc_connect () function is used to connect to odbc data sources. The function has four parameters: data source name, user name, password, and optional pointer type parameters. odbc_exec () function is used to execute the sql statement $ db_user = "dbuser"; / / define the connection username $ db_pass = & ...

PHP content paging source

PHP code: <? Php $ contents = "fjka; fjsa; # page # Batch [newpage] # page # composition of the document # page # And # paging code page"; / / with the original tabbed content $ cons = "fjka; fjsa; adsfasdfas yards"; & nbs ...

Open the directory in php and output directory file to achieve the code

The opendir () function opens a directory handle that can be used by closedir (), readdir (), and rewinddir (). Syntax opendir (path, context) * / $ d = dir ("c: windows"); / / Open the directory, and assigned to the variable echo "ha ...

php directory manipulation functions (delete, create, determine)

This article is mainly introduced in php tutorial directory operations functions is_dir, rd_dir, mkdir and other commonly used directory operation function examples. * / function dir_writeable ($ dir) / / Custom function extensions to create a writable directory {if (! is_dir ($ dir)) & nb ...

PHP performs the six commonly used functions of Linux commands

2, system function <? Php $ test = "ls / tmp / test"; $ last = system ($ test); print "last: & ...

PHP code to determine whether the server port is open

Record, after the backup <? Php $ host = 'www.google.com'; / / to ping the address, it can be IP $ port = '80'; / / to ping the port $ num = 3; function microtime_float () & nbs ...

php dynamically generated pie chart code

* / // Create an image $ image = imagecreatetruecolor (300,300); // Define the color you want to draw the pie chart $ white = imagecolorallocate $ image = 0x0 0xff 0xff $ gray = imagecolorallocate $ image 0xc0, 0xc0, 0xc0); $ darkgray = imagecolorallocate (...

php create distortionless HD image implementation code

In the php tutorial to generate high-definition images must be used imagecreatetruecolor function to do, see below its usage imagecreatetruecolor (int x, int y) to create a black image of size and y, and its examples did not use Instead of adding the background color to the generated pixel, a color of the drawing is created directly using imagecolorallocate () * / / / Create image $ im = imagecreatetruecolor (...

PHP backup database for SQL files and download source

This is a backup of all the tables in the specified database as an SQL file that can be downloaded. This source comes from dedecms procedures, functions Tingduo, very practical, but the quality of the code still needs to be improved <!? php / ****** backup database structure ****** / ...

Share the top ten PHP development engineer's development principles

I want to dizzy, in the end I want to listen to whom? In the web development world, PHP is one of the most popular languages, and from PHP you can easily find the script you need. Unfortunately, few people use "best practices" to write a PHP program. Here, we introduce PHP 10 best practices, of course, each one is proven by masters derived. 1. Use PHP at the right time - Rasmus Lerdorf No one better than PHP creator Rasmus Lerdorf understands that PHP is used in ...

Website anti-injection and hang-up PHP.INI security settings

When you want to prevent page attacks, you can include the anti-attack file in the header of the page, just like universal anti-injection file. We can do it in three ways: 1, in each document cited. Such a file is fine, but not convenient if there are hundreds of files in a website. 2, reference in the included file, such as config.inc.php tutorial. This is a good way, but also the more popular way on the market today. 3, referenced in php.ini. Cited in the configuration file, it will affect all sites, including all ...

php get_cfg_var Get PHP configuration

Obtain php tutorial configuration option value. Syntax: string get_cfg_var (string varname); Return Value: String Function Type: php System Function Description If the current php configuration options varname, it returns the value of the variable. If it fails, it returns false. * / echo "php set the maximum execution time: n"; print_r (get_cfg_var (& q ...

php generates a random number mt_rand () rand () mt_srand () function

mt_rand () Returns a random integer using the mersenne twister algorithm. Syntax mt_rand (min, max) Description mt_rand () returns a pseudo-random number from 0 to rand_max if the optional parameters min and max are not provided. For example, want a random number between 5 and 15 (including 5 and 15), using mt_rand (5, 15). * / echo mt_rand (); & nb ...

php include () call file simple instance

// include.php file echo a (); / / result bb?> include.php file as follows <? php // create include.php for other file calls function a () / / Define function a {b (); ...

php max () min () Returns the maximum and minimum values

max () returns the maximum value. Syntax max (x, y) Parameter Description x Required. A few. y necessary. A few. Description max () Returns the value with the highest value in the argument. If there is only one parameter and an array, max () returns the largest value in the array. If the first argument is an integer, string, or floating point number, at least two arguments are required and max () returns the largest of these values. You can compare an unlimited number of values. echo max (1,3,5,6,7); & ...

PHP commonly used mathematical functions

The math functions commonly used in the php tutorial The tanh () function returns the hyperbolic tangent. Syntax tanh (x) Parameter Description x Required. A few. Description Returns the hyperbolic tangent of x, defined as sinh (arg) / cosh (arg). * / echo tanh (-m_pi); / / output -0.996272076221 echo & quo ...

Several commonly used php buffer technology examples

// initialize the session session_start (); // add the value of the url rewrite output_add_rewrite_var ('var', 'value'); // insert a link echo '<a href="file.php">">"> link </a> </a> ; / / Send buffer data ob_flush (); // reset the value of url rewrite o ...

php query ip location code

<? php tutorial / ** * @ date 2010.12.21 * @ author Wang Gang * @ email 373882774@qq.c ...

Total Pages: 18 1 .... 7 8 9 10 11 .... 18 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.