PHP file operations

PHP file operations // Filetype () Obtain the object type // Obtain the file type in windows Echo filetype ("D :\\ lamp \ php5 \ php. ini ").""; // The output file indicates a normal file.

Php checks whether the browser is a mobile device

Php checks whether the browser is a mobile device This code can be used to check whether users are using mobile devices to browse the web page. $ Mobile_browser = '0 '; If (preg_match ('/(up. browser |

Object-oriented mysql database operations php class

Object-oriented mysql database operations php class Class database { Var $ host = NULL; Var $ username = NULL; Var $ password = NULL; Var $ databaseName = NULL; Var $ link = NULL; Var $

Php uses GD to create a thumbnail that maintains the aspect ratio

Php uses GD to create a thumbnail that maintains the aspect ratio /** * Create a thumbnail image from $ inputFileName no taller or wider * $ MaxSize. Returns the new image resource or false on error. * Author:

PhpXSS security filtering code

PhpXSS security filtering code Function remove_xss ($ val ){ // Remove all non-printable characters. CR (0a) and LF (0b) and TAB (9) are allowed // This prevents some character re-spacing such // Note that

Php returns relative time, such as: 20 minutes ago, 3 days ago

Php returns relative time, such as: 20 minutes ago, 3 days ago Function plural ($ num ){ If ($ num! = 1) Return "s "; } Function getRelativeTime ($ date ){ $ Diff = time ()-strtotime ($ date );

Comparing the similarity codes of two strings in php

Comparing the similarity codes of two strings in php How to Calculate string similarity similar_text and similarity in php $ First = "abcdefg "; $ Second = "aeg "; Echo similar_text ($ first, $ second); result

Use PHP to scale up or down images

Use PHP to scale up or down images Function resizeimage ($ srcfile, $ mySize ){ $ Size = getimagesize ($ srcfile ); Switch ($ size [2]) { Case 1: $ Img = imagecreatefromgif ($

Php compresses the file into a zip file

Php compresses the file into a zip file PHP ZipArchive is an extension class that comes with PHP. it can easily compress and decompress ZIP files. before using it, make sure that the php zip extension is enabled. /*

PHP code for downloading remote files to local storage

PHP code for downloading remote files to local storage Function GrabImage ($ url, $ filename = ""){ If ($ url = "") return false; If ($ filename = ""){ $ Ext = strrchr ($ url ,"."); If ($ ext! = ". Gif"

Convert a php image to an ASCII code

Convert a php image to an ASCII code Convert a php image to an ASCII code. after conversion, you can directly display the image using a string. Ascii $ Image = 'image.jpg '; //

PHP calculates the information of a specified folder (number of folders, number of files, and folder size)

PHP calculates the information of a specified folder (number of folders, number of files, and folder size) // The code can also be used to count the number of directories // Format the size of the output

Php-implemented memcached queue class-php Tutorial

Memcached queue class implemented by php /* * Memcache queue * Supports concurrent write and read operations in multiple processes. * Write-while-read, replacement of AB rotation * @ Author guoyu *

PHP calculates the distance between two points on the map

PHP calculates the distance between two points on the map Class GeoHelper { /** * @ Param int $ lat1 * @ Param int $ lon1 * @ Param int $ lat2 * @ Param int $ lon2 * @ Param string

Php dynamically creates a function at runtime

Php dynamically creates a function at runtime General language functions must be defined as running, while php supports dynamic function creation at runtime. The following is a simple example: create a function based on different

Php + mysql paging

Php + mysql paging Encapsulated class: /*************************************** ****** Class name: PageSupport Function: displays data in the mysql database by page. **************************************** *

Symmetric encryption algorithm provided by php

Symmetric encryption algorithm provided by php KEY is a previously defined constant.Mcrypt: encrypt ();Mcrypt: decrypt (); Defined ('root') or exit ('Access Denied '); Class Mcrypt { Public static

Php obtains the current domain name, host, URL, port, parameter, URL, path, proxy, and so on.

Php obtains the current domain name, host, URL, port, parameter, URL, path, proxy, and so on. // Obtain the domain name or host address Echo $ _ SERVER ['http _ host'].""; // Obtain the webpage address Echo

Csv file reading in php

Csv file reading in php Define ("CSV_Start", 0 ); Define ("CSV_Quoted", 1 ); Define ("CSV_Quoted2", 2 ); Define ("CSV_Unquoted", 3 ); Function readCSV ($ fh, $ len, $ delimiter = ',', $

Php generates a verification code Image of numbers and letters

Php generates a verification code Image of numbers and letters Php generates a verification code Image of numbers and letters Header ('content-Type: image/png '); $ Image = imagecreatetruecolor (100, 30 );

Total Pages: 12780 1 .... 10510 10511 10512 10513 10514 .... 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.