PHP technical code -- get the file extension

Php code// Method 1:Function extend_1 ($ file_name){$ Retval = "";$ Pt = strrpos ($ file_name ,".");If ($ pt) $ retval = substr ($ file_name, $ pt + 1, strlen ($ file_name)-$ pt );Return ($ retval );} // Method 2Php codeFunction extend_2 ($

Google translation API (php api)

/* Google Translate PHP Interface * Official Documents * Http://blog.csdn.net/aprin/ * Note: if the translation text is UTF-8 encoded, delete the mb_convert_encoding Function */ Class Google_API_translator { Public $ url =

Simple, convenient, and fully functional php paging class

Paging Code each_disNums = intval ($ each_disNums); $ this-> nums = intval ($ nums); if (! $ Current_page) {$ this-> current_page = 1;} else {$ this-> current_page = intval ($ current_page);} $ this-> sub_pages = intval ($ sub_pages ); $ this->

CI framework source code reading --------- hook class hooks. php

[Php] _ ini Tialize (); log_message ('debug', "Hooks Class Initialized");} // specify/*** Initialize the Hooks Preferences parameter, preference * initialization hook * @ access private * @ return void */function _ initialize () {$ CFG = &

Use PHP extension vld to view PHP opcode

~ /Public_html/php-5.3.13/ext> wget http://pecl.php.net/get/vld-0.11.2.tgz ~ /Public_html/php-5.3.13/ext> tar zxvf vld-0.11.2.tgz ~ /Public_html/php-5.3.13/ext> cd vld-0.11.2/then compile and install the vld Extension :~

Explanation of PHP date and Time Functions date ()

PHP date and Time Functions date () 1, year-month-day echo date ('Y-m-J'); 2007-02-6 echo date ('Y-n-J '); 07-2-6 uppercase Y indicates four digits of the year, while lowercase y indicates two digits of the Year. lowercase m indicates the number of

Php File Operations

Print? Ini_set ('memory _ limit ','-1 ');//Ini_set ("max_execution_time", "3600"); // set the timeout value. Using filep;'qq.txt ';  Using str=file('qq.txt ');$ LineCount = 0;Foreach ($ str AS $ line ){$ Line = str_replace ("\ t", "", $ line );$ Tr =

Php Remote copy and Command Execution

The module used for php Remote file copy and command execution on the remote server is ssh2, and all subsequent operations are completed based on the ssh2 connection handle. 1. Install the SSH2 Module1.1 install the required extension package [Plain]

Curd operations of ThinkPHP

ThinkPHP provides flexible and convenient data operation methods. It not only implements four basic operations (CURD) for database operations: creation, reading, updating, and deletion, there are also many built-in practical data operation methods

Php Environment Construction

I installed Windows 7 in the past two days. Some time ago, a friend asked me how to install and build the PHP environment in Windows. So I plan to work hard to build the PHP environment step by step, currently, you do not need to use the PHP

Calculate the data of the day from the start point and end point timestamp.

[Php]/* * + ------------------------------- * Calculate the data of the day from the start point and end point timestamp. * + ------------------------------ */ $ Daybegin = strtotime (date ("Ymd "));$ Dayend = $ begin + 86400;$ Query = "SELECT *

Php practice 14th days

Today I learned the curl Extension function. I wrote an httpPost function, which is effective. I want to use it for online updates or download remote resources online. [Php]Echo httpPost ("http://bbs.125.la/member.php? Mod = logging & action = login

Php practice 15th days

Learn curl again today   PHP provides curl _ * series of functions to operate curl. The following are commonly used: Curl_init initializes a curl session Curl_close: of course, this is disabled --! Curl_error: the error message of the current

Use global variables in PHP

Even if you develop a new large PHP program, you must use global data, because some data requires different parts of your code. Some common global data includes program setting, database connection, and user data. There are many ways to make this

Php practice 20th days

Strictly speaking, these days have been the practice of div + css and ps.     Css also comes and goes with those attributes. [Css]@ Charset "UTF-8 ";/* CSS Document*{Margin: 0px;Padding: 0px;Font-size: 14px;}Body {Background-color: # ECECEC;} # Head

Htmlspecialchars () and htmlentities () of php Functions

  When the web editor writes articles to the database or reads the database content, there are often non-resolution issues and a lot of code, which is actually a problem of html Entity and corresponding String Conversion. It mainly involves

Yii -- Command Task Processing

1. Configure the components required to execute the taskTask configuration file:/protected/config/console. phpThe configuration method is similar to the configuration of the main file [html] // This is the configuration for yiic console application./

Robust I/O function code of the RIO package

[Php]The following is about The following describes [php]# Include # Include # Include # Include # Include # Include  # Define MAXLINE 1024 /* Unbuffer input/output function */ Ssize_t rio_readn (int fd, void * usrbuf, size_t n){Size_t nleft =

Php parsing xml

1. simplexml SimpleXML converts an XML document to an object, for example:Element-a single attribute of the SimpleXMLElement object. When multiple elements exist at the same level, they are placed in an array.Attribute-access by using an associated

Ceil, floo, and round functions in php

Ceil is a function that returns a value in the ascending order; Floor is a function used to remove the decimal places to get a value; Round is a rounding function. CeilDefinition and usage: The ceil () function rounds up to the nearest integer. [Php]

Total Pages: 12780 1 .... 4868 4869 4870 4871 4872 .... 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.