PHP Getting Started Tutorials (21) PHP date and time functions

echo Time (); Return "1264668961" ?> Copy Code2,date ()The date () function is required to convert the UNIX timestamp to the current time that can be read.The prototype of the date function is as follows:

Sample code for PHP to detect upload Excel file types

/** * Detect upload file type * Detect the type of Excel file for uploading files * @param array $file * @return BOOL $flag * @site bbs.it-home.org */ Private Function Detectuploadfilemime ($file) { 1.through

PHP page Jump function page redirection

if (Isset ($url)) { Header ("http/1.1 303 See other"); Header ("Location: $url"); Exit From bbs.it-home.org } ?> Copy CodeNotice that "localtion:" has a space behind it.HTML markup with

PHP code conversion for GBK encoding conversion to UTF8

Class Gb2utf8 { var $gb; gb2312 string to convert var $utf 8; Converted UTF8 string var $codetable; An array of gb2312 code files used in the conversion process var $errormsg; Error messages during the conversion process

PHP Common escape character function

This paper introduces the character escaping functions and security functions commonly used in PHP, and uses these functions to filter the most common attack methods, such as SQL injection.Contents of this section: PHP Escape character function

PHP Date Processing Small example MySQL by date, time query example

PHP Date Processing Date_default_timezone_set (' PRC '); Default time zone echo "Today:", Date ("Y-m-d", Time ()), ""; echo "Today:", Date ("Y-m-d", Strtotime ("June 2008")), ""; echo "Yesterday:", Date ("Y-m-d",

Php+mysql database query Pagination code example

/* * Php+mysql Pagination Code * */ $SQL _tabl= "ABC"; Table name $where _name= "ID > 10";//Query criteria $perpagenum = 3; Display quantity per page $total = Mysql_fetch_array (mysql_query ("SELECT count (*) as

Example of a PHP regular expression escape character

$str = Preg_quote ("/\d{3} (\-\d{4})/"); Echo $str; ?> Copy CodeResults:/\\d\{3\}\ (\\\-\\d\{4\}\)/Example 2: $str = Preg_quote ("/\d{3} (\-\d{4})/", "3"); Echo $str; ?> Copy

PHP Date Function Example: Get the last day of the month

/** * Date-get last day of the month * @return int */ Public Function Get_lastday () { if ($this->month==2) { $lastday = $this->is_leapyear ($this->year)? 29:28; } elseif ($this->month==4 | |

Eight PHP data type usage details PHP data type conversion Advanced Tutorial

PHP commonly used eight types of data usage, including Boolean type, Integer, array type, and so on, from the name of the PHP data type, presentation methods and range of values to describe the use of these data types. What are the PHP

Two ways to get Image color values in PHP

Two ways to get Image color values in PHP >16) & 0xFF; $r = ($rgb >>16) & 0xFF; $g = ($rgb >> & Amp 0xFF, $b = $rgb & 0xFF, $rTotal + = $r, $gTotal + = $g, $bTotal + = $b, $total + +;}} $rAverage = Round ($rTotal/$total); $gAverage

WordPress Support Upload image How to implement?

This article describes the WordPress only support upload images of the real Now the method, using the custom function to implement the image upload function, do not allow other files to upload, the need for a friend reference. !--ad-->!--ad--end-->

12 key steps to fix a programming bug

Boss: So, how long do you need to fix this bug? Inexperienced programmer: Give me one hours? Up to two hours? I can fix it right now! Experienced programmers: So, how long will it take me to catch a fish?! It's hard to know beforehand how long it

PHP iconv function solves utf-8 and gb2312 encoding conversion problem

$content = Iconv ("Utf-8", "gb2312", $content); Copy CodeIn fact, it is also right, looking at the Utf-8 is actually converted into gb2312, but the actual operation of the words, often fail to end, why?The reason is simple, because any function

Phpexcel How to read Excel files? Phpexcel example of reading an XLS file

Error_reporting (E_all); Date_default_timezone_set (' Asia/shanghai '); /** Phpexcel_iofactory */ Require_once '. /classes/phpexcel/iofactory.php '; Check Prerequisites if (!file_exists ("31excel5.xls")) {

PHP Template Parsing class

PHP Template Parsing class Class Template { Private $vars = Array (); Private $conf = '; Private $TPL _name = ' index ';//If the template does not exist, it will find the current Controller default index

PHP How to view directory information PHP custom functions copy and delete directory files

PHP How to view directory size and other information, PHP How to copy directories and delete files, PHP recursively delete directories and subdirectories of the custom function code, you can recursively query the directory file size, so as to count

A good PHP validation class

/** * Validation Class * * @lastmodify 2014-5-16 * @author jy625 */ Class verifyaction{ /** * is a null value */ public static function IsEmpty ($STR) { $str = Trim ($STR); Return!empty

PHP 10 Advanced Tips (upper and lower) 1th/3 page _php Tutorial

PHP is used by administrators of more than 3 million Internet sites worldwide, making it one of the most popular server-side scripting languages. It is characterized by fast running, stable and reliable, cross-platform, and open source software.

Encounter PHP In_array Low performance Problem _php Tutorial

PHP's performance has been improving. However, if the use of inappropriate, or a inattention, still may be stepping on the internal implementation of PHP hole. I ran into a performance problem a few days ago. The thing is this, a colleague feedback

Total Pages: 5208 1 .... 655 656 657 658 659 .... 5208 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.