Cookies in PHP are in time and can be used without refreshing

Today encountered a PHP cookie must be refreshed before the problem, you can use the method to solve: PHP cookie Setup function takes effect immediately, supports arrayfunction Cookie ($var, $value = ', $time = 0, $path = ', $domain = ', $s = false)

Example of PHP output JSON format data

We have to use Content-type:text/json to display the JSON data properly. The code is as follows Copy Code Header (' Content-type:text/json '); This is the point, it tells the object receiving the data this page output is

Calculation and current time lag how many days (js/php)

We sometimes encounter more specific needs when doing a site, a message is a few days and days or one months ago, the last time you do an app ran into this week, leaving the code used at that time do not need to run around. PHP Code: function

PHP time data converted to timestamp code

To do time data conversion to timestamp we use the PHP tutorial with functions, the strtotime () function resolves the date-time description of any English text to a Unix timestamp Format one Fri Aug 05 12:19:04 +0800 2011 Strtotime ("Fri Aug 05

PHP bitwise operator

Bitwise operators Bitwise operators allow placement of the bits specified in the integer number. If both the left and right arguments are strings, the bitwise operator will manipulate the ASCII value of the character. Do not move more than 32 bits

PHP Array Pointer usage detailed

Let's start with a conclusion, and then we'll use the code to prove the conclusion. $arrtmp = $arr; In this assignment expression, I call $arr an array of assignments, and $arrtmp is called an array of assigned values. If an array pointer to an

PHP scandir traversal shows all files and folders under the file

PHP Tutorial Scandir traversal display all files and folders under the file, the method is very simple we only use the Is_dir to determine the recursive lookup once, so you can traverse the directory all the files. Directory traversal  

PHP Regular expression verifying the user name URL of the mailbox format

We used the PHP tutorial Ereg function to verify the email address, username, URL address instance. Split the URL ?$url = "Http://www.111cn.net"; $www _url = Ereg ("^ (http://www)." [[: alnum:]]+]. ([[: alnum:]]+) ", $url, $regs); if ($

PHP Delete record and delete picture file program

*/$CN = MySQL Tutorial _connect (' 127.0.0.1 ', ' root ', ' root ') or Die (' Database connect fail ');mysql_select_db (' Test ', $CN);mysql_query ("Set names ' GBK '"); /*Create a database tutorialCREATE DATABASE ' test '; Create data Table Test1

PHP multi-dimensional array sorting implementation code

Sort by single arraySort functions in ascending orderBool sort (array & $ array [, int $ sort_flags = SORT_REGULAR]) The code is as follows:Copy code $ Fruits = array ("lemon", "orange", "banana", "apple ");Sort ($ fruits );Var_dump ($ fruits );?

Difference between php date () and gmdate ()

Date-format a local time/dateThe date/time function allows you to extract and format the date and time on the server.Note: these functions depend on the local settings of the server.InstallThe date/time function is a core component of PHP. These

Explain the functions of mb_strlen and strlen in php

// During the test, the file encoding method is utf8.$ Str = 'Chinese character a 1 ';Echo strlen ($ str). ''; // 14Echo mb_strlen ($ str, 'utf8'). ''; // 6Echo mb_strlen ($ str, 'gbk'). ''; // 8Echo mb_strlen ($ str, 'gb2312'). ''; // 10?>Result

Open the Directory in php and output the directory file implementation code

 SyntaxOpendir (path, context)*/$ D = dir ("c: windows"); // open the directory and assign the value to the variableEcho "handle:". $ d-> handle. "n"; // handel attribute of the output DirectoryEcho " ";Echo "path:". $ d-> path. "n"; // path

Check whether the php array contains specified characters and array length

The in_array () function searches for the given value in the array.SyntaxIn_array (value, array, type)*/ The code is as follows:Copy code $ OS _list = array ("mac", "nt", "irix", "linux"); // defines an arrayIf (in_array ("irix", $ OS _list) //

Use curl_init function (1/4) in PHP)

The code is as follows:$ Ch = curl_init ();$ C_url = 'http: // www.111cn.net;$ C_url_data = "product _ & type =". $ type ."";Curl_setopt ($ ch, curlopt_url, $ c_url );Curl_setopt ($ ch, curlopt_post, 1 );Curl_setopt ($ ch, curlopt_returntransfer,

Php time zone setting difference 8 small time program and php. ini configuration method

/*1. Set php. ini, find data. timezone = in php. ini, remove the; sign, and set data. timezone = "asia/shanghai.2. Through php page settings, we can add date_default_timezone_set ('Asia/Shanghai') to the php page ');Or ini_set ('date. timezone ',

Php quick url rewriting instance

Php tutorials can be used only in versions later than 5.30, inheriting the features of fast redirection in the previous version (separate classes, all use static calls ), A very important function and attribute can be added to call the modules in

CentOS5.5 install the php_svn module to use PHP to submit files to SVN

To use SVN functions such as SVN_AUTH_PARAM_DEFAULT_USERNAME for the project, install the php_svn Extension Library.PHP version: PHP 5.3.14 (php-v)Operating system: CentOS release 5.5 (Final) (lsb_release-)I. Compile and install phpII. Compile and

Example of foreach and list loop statements in php

I recently bought php and mysql web development and saw the array loop statements. It is worth your attention and I will keep some handwriting for later reading.Generally, foreach uses more The code is as follows:Copy code $ Price = array

Php loop control statement

Foreach statementThe Foreach loop is introduced in php4.0 and can only be used as an array. In php5, object support is added. The syntax format of this statement is:Foreach (array_expression as $ value)Statement;Or The code is as follows:Copy code

Total Pages: 12780 1 .... 2639 2640 2641 2642 2643 .... 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.