Php

Discover php, include the articles, news, trends, analysis and practical advice about php on alibabacloud.com

PHP Unlimited level Create directory several functions

PHP Unlimited level Create directory several functions function mkdirs ($dir) {if (!is_dir ($dir)) {if (!mkdirs (DirName ($dir))) {return false;}  if (!mkdir ($dir, 0777)) {return false;} &nbs ...

PHP mysql Date calculation code [DATEDIFF

Oh, the following code is a little messy ah, is what I do in the test, PHP mysql date calculation code [DATEDIFF] is also the day I need to try it. Here's a look at Code function A ($d) {$Date _1=date ("y-m-d"); $Date _2= $d;   $Date _list_a1=explode ("-", $Date _1); $Date _l ...

PHP Get file size function and instance tutorial

PHP Get file size function and instance tutorial <?php function GetFileSize ($url) {$url = Parse_url ($url); if ($fp = @fsockopen ($url [' Host '],empty ($ url[' Port ']: $url [' Port '], $error)] {fputs ($fp, "get". Empty ($ ...)

PHP anti-Malicious Refresh code Instance

Anti-malicious refreshing PHP Tutorial Instance code is very instance, we often in order to prevent some of the user against malicious users to refresh the following let's take a look at this example code. <?php session_start (); $k =$_get[' K ']; $t =$_get[' t ']; $allowTime = 1800;//anti-refresh Time $ip = Get_client_ip (); $allowT = MD5 ...

php regular specified string content preg_match function description

php tutorial Regularly specify the string content Preg_match function description Although the code is small, but the code is as follows: preg_match ('/ ^ (?! string) /', 'aa') === true This is used to verify a Whether a string begins with a 'string' or not, in a perl or perl-supported regular expression language such as php, can be done with a look-ahead declaration, as the regular expression is: preg_mat. ..

Two php interception string function

Provide two php tutorial interception string function, they can automatically identify the Chinese Oh, if you are intercepting the article this is very good, like to come in and see it. <? php header ("content-type: text / html; charset = utf-8"); function strcut ($ string, $ length, $ dot = '...', $ chars ...

php search csv form whether there is specified data

php tutorials search csv form there is no specified data // search cessory csv data principle is to open the csv file, and then search for the specified line by line contains whether we read the code, if it is true. // Search for the contents of csv $ fh = @fopen ("csv_file_name", "r"); if ($ fh) {if (flock ($ fh, lock_ex) ...

PHP two tables merged into a new table and ordered

PHP tutorial The two tables are merged into a new table and ordered <?php/** LA (3,5,8,11) lb (2,6,8,9,11,15) is merged into LC, arranged in order. With PHP, you can't use functions like sort!!!!     **/class Union {var $lista = array (); var $listb = array ...

PHP gets file extension two effective methods

PHP Tutorial Get file Extension Two effective methods $upload _name = ' Www.jzread.com.rar ';    $attach _ext = Strtolower (substr (STRRCHR ($upload _name, '. '), 1)); Echo $attach _ext;//method Two $extarray = Explode ('. ',...

PHP upload a picture and make a transparent watermark

PHP Tutorial upload pictures and a transparent watermark to the picture $im = Imagecreatefromjpeg ($_file["Upload"] ["tmp_name"]); You want to fetch water. Example of the picture $watermark = Imagecreatefrompng ("Smiley.png"); The path $im _x = Imagesx ($im) of the watermark map; ...

PHP Scale Small graph function

PHP Tutorial Scaling Small graph function <?php class My_lib_functions {# ******************************************** # object to array # ************** function Object2array ($obj) {&nb ...

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 ...

PHP connects to access and reads data from an Access database

PHP connects to access with an ODBC-related function. The code for the connection is as follows: <?php $connstr = "Driver=microsoft Access DRIVER (*.mdb);D bq=". Realpath ("Mydb.mdb"); $connid =odbc_connect ($connstr, "", "",...

How long does the PHP calculation page program execute?

PHP Tutorial calculates how long the page executes the Code function test () {list ($a, $b) = Explode ("", Microtim ...)

PHP processing from MySQL to export data to XLS garbled

PHP Tutorial Excel class from the MySQL tutorial to export data to XLS garbled $objPHPExcel->setactivesheetindex (0)->setcellvalue (' A1 ', iconv (' GBK ', '   Utf-8 ', ' Chinese Hello ')->setcellvalue (' B2 ', ' world! ') ->setcell ...

PHP query Baidu included query code

PHP to provide PHP queries written query code download Oh, look at it very easy oh.  function Baidu () {global $murl, $furl;  $url = "Http://www.baidu.com/s?wd=site: $furl";  $page = file_get_contents ($url); $Page ...

PHP Judge page program execution time code

The PHP tutorial determines the page execution time code to determine the time required for the PHP script to execute correctly for a microsecond.         Inserts the code at the top of the page: <?php $mtime = Microtime (); &nbs ...

PHP substr_replace Replacement string Specify position character

PHP substr_replace Replacement string Specify position character/* int Mb_strlen (string $str [, String $encoding]) <?php tutorial echo substr_replace ("Hello World ", the Earth", 6); Hello Earth?> is worth mentioning, when start and length are ...

PHP options and Information function library: Php_sapi_name

Php_sapi_http://www.aliyun.com/zixun/aggregation/11696.html ">name (PHP4 >= 4.0.1) php_sapi_name--- Returns the interface syntax between Web servo and PHP: String php_sapi_name (void) Description: Php_sapi_name () returns a lowercase ...

php traverses all the directories and files in a folder

We often encounter this problem in the interview: PHP Traverse all the files and subfolders under a folder. There are many solutions to this problem. But the general idea is the same. Recursive. $ path = './filepath'; function getfiles ($ path) {...

Total Pages: 27 1 .... 5 6 7 8 9 .... 27 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.