Php BASICS (1)

Php supports four tag styles:1)Echo "this is an xml style Mark"; // recommended?>2)3)4)Echo "this is an ASP-style Mark ";%>/*To use the short style and asp style, you need to configure it in php. ini, and then set short_open_tag and asp_tags to ON*/

TWIG function Learning

Currently, the built-in functions of twig include: Attribute, block, constant, cycle, dump, parent, random, range. In fact, some functions have been seen in the learning of tags.   Attribute functionNew Version 1.2It is equivalent to a.

PHP image shrinking Function

Deleted original image, retained Image/*** Function for downgrading Images* @ Param string $ fileName* @ Return void*/Private function createSmallImg ($ fileName){List ($ width, $ height, $ type, $ attr) = getimagesize ($ fileName );$ ImgOld =

Regular Expression for php knowledge point Review

Previous http://www.bkjia.com/kf/201202/118458.html// Technical knowledge of Regular Expressions  // [] Define Character Set and example [a-z] [A-Z] [0-9] [\ f \ r \ n \ t]  // Positioning character ^ [A-Z] [0-9] $ beginning and end  // Quantifiers *

Capture the "Global IC Procurement Network" supplier Program

/*** Capture the "Global IC purchasing network (http://www.qic.com.cn/)" vendor main program* Author Lee.* Last modify $ Date: 2012-2-7 09:35:21 $*/Require_once './config. inc. php ';Class qic {Private $ startId;Private $ endId;Public function _

Php collection warehouse receiving

If ($ _ GET [id] $ Con = file_get_contents ("http://book.qq.com/lianzaiindex/sort4/index_". $ _ GET ['id']. ". htm ");// Echo $ con;$ Preg = "# (. *) # iUs "; Preg_match_all ($ preg, $ con, $ arr );$ Time = time (); Foreach ($ arr [1] as $ k => $

Php multiple-choice Deletion

SQL: $ SQL = "delete from 'doing' where id in ('1, 2, 3, 4 ')";Data are separated by commas.Form:Good $ ID_Dele = $ _ POST ['id _ Dele '] will be an array. Although PHP is of a weak type, ASP is not weak here.ASP can be directly:SQL = "delete from

How to generate static web pages through smarty

The biggest function of Smarty is to cache pages of templates. That is, two steps can be completed through Smarty: Compilation + parsing.Step 1: compile. It refers to replacing the tag of the template file with pure php, and then saving the cache

PHP mail configuration

I want to use PHP to mail (yuan_ping@163.com sent to nnnnyyyy@21cn.com) According to some books write a piece of program, but the operation is not successful. Why? // Declare the email address as the receiving email address$ MailTo =

PHP's second play-Application of classic algorithms (Bubble sorting and quick sorting)

First of all, let's talk about the idea of Bubble sorting. Many colleagues will ask what is Bubble sorting? I will explain it below: The so-called Bubble sorting method compares two adjacent numbers in sequence, placing Decimals in front, and

PHP Chinese garbled Solution

PrefacePHP Chinese Garbled text is one of the common problems in PHP development. Chinese Garbled text sometimes occurs on the web page. Some are generated during MYSQL interaction and sometimes related to the operating system. The following is a

Three sorting methods of arrays in PHP

I. Bubble SortingNote: Find the maximum number, arrange it to the last side, and continue to find it. Example:$ Arr = array (3,5,-1,0, 2 );For ($ I = 0; $ I For ($ j = 0; $ j If ($ arr [$ j]> $ arr [$ j + 1]) {$ Temp = $ arr [$ j];$ Arr [$ j] = $

Php-Arrays function-array_merge_recursive-recursively merges one or more Arrays

Array_merge_recursive () recursively merges one or more Arrays [Function]This function combines the units of one or more arrays. The values of an array are appended to the values of the previous array.Returns an array of results. If the input array

Php-Arrays function-array_unique-Remove repeated values from the array

Array_unique () removes repeated values from the array [Function]This function returns a new array with no repeated values based on the specified array, and the key name remains unchanged.This function first sorts values as strings, and then retains

PHP error handling

As long as the program is running, errors will inevitably occur! It's just a matter of time.Errors are common, such as Notice and Warning. Set_error_handler is generally used for processing: Set_error_handler (function ($ errno, $ errstr, $ errfile,

Use static in php Functions

Function sendHeader ($ num, $ rtarr = null ){Static $ sapi = null;If ($ sapi === null ){$ Sapi = php_sapi_name ();}Return $ sapi ++;When reading the PW source code, I found that the setHeader () function uses the static keyword. It is strange that

PHPExcel php execl download or save to local

Public static function saveExcel ($ objPHPExcel, $ excelName, $ output ){$ ObjWriter = PHPExcel_IOFactory: createWriter ($ objPHPExcel, 'excel5 ');If (! Strpos ($ _ SERVER ['HTTP _ USER_AGENT '], 'Firefox '))$ ExcelName = urlencode ($ excelName );If

Use PDO in php to create a sqlite3 Database

Error 1:1 Uncaught exception 'pdoexception' with message' could not find driver1. Open the php. ini file.1 extension = php_pdo.dllRemove1 extension = php_pdo_sqlite.dll2. Restart the apache service.3. Write test code 01 02 echo "creating a databse \

Permanent data connection mysql_pconnect

Mysql_pconnect () and mysql_connect () are very similar, but there are two main differences. First, when connecting, this function will first try to find a (persistent) connection that has been opened with the same user name and password on the same

Database Master/Slave settings

For projects with relatively large access volumes, we often use the database master-slave mode for read/write splitting to divert user operations and achieve load balancing. Therefore, I searched for the relevant information on the Internet and made

Total Pages: 12780 1 .... 10127 10128 10129 10130 10131 .... 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.