PHP code used to determine whether a device is a mobile phone or tablet

PHP code used to determine whether a device is a mobile phone tablet Page matching for mobile devices is often required during web development. of course, you can directly make the website responsive, but if you don't want to do this, you

Verify the validity of the ID card in PHP.

Verify the validity of the ID card in PHP. /** * ID card * * @ Param string $ id * @ Return boolean */ Function is_idcard ($ id) { $ Id = strtoupper ($ id ); $ Regx = "/(^ \ d {15} $) |

A simple PHP class for a socket client

A simple PHP class for a socket client Php 5. You need to enable socket extension // Socke operation class Class Socket { Private $ host; // host connected to the socket Private $ port; // the port number of the

PHP mail operations

PHP mail operations Class smtp { Var $ smtp_port; Var $ time_out; Var $ host_name; Var $ log_file; Var $ relay_host; Var $ debug; Var $ auth; Var $ user; Var $ pass;

PHP sensitive word filtering code-php Tutorial

PHP sensitive word filtering code $ F = file('words.txt '); $ Words = array (); Foreach ($ f as $ w ){ $ Words [] = preg_quote (trim ($ w ),'/'); } $ Text = file_get_contents('text.txt '); $

PHP downloads/collects remote images to a local device

PHP downloads and collects remote images to a local device /** * Download a remote image to a local device. * * @ Param string $ url remote file address * @ Param string $ filename name of the saved file (if

PHP a simple and quick sorting

PHP a simple and quick sorting Fast sorting by constantly locating the location of the benchmark number /** * Created by PhpStorm. * User: saint * Date: 15/8/5 * Time: AM */ Class Demo {

PHP adds subtitle display to the video through ffmpeg

PHP adds subtitle display to the video through ffmpeg $ Dir = './'; // set to current folder If ($ handle = opendir ($ dir )){ While (false! ==( $ File = readdir ($ handle ))){ If (is_file ($ dir. $ file )){

Php compresses CSS files

Php compresses CSS files Compressing multiple CSS files at a time Header ('content-type: text/css '); Ob_start ("compress "); Function compress ($ buffer ){ /* Remove comments */ $ Buffer = preg_replace ('! /\

PHP parses XML data

PHP parses XML data $ Xml_string =" Ben A H2o K "; // Load the xml string using

PHP obtains the real IP address of a user.

PHP obtains the real IP address of a user. Function getRealIpAddr () { If (! Emptyempty ($ _ SERVER ['http _ CLIENT_IP ']) { $ Ip = $ _ SERVER ['http _ CLIENT_IP ']; } Elseif (! Emptyempty ($ _

PHP extracts the main color of any image

PHP extracts the main color of any image Function dominant_color ($ image) { $ I = imagecreatefromjpeg ($ image ); For ($ x = 0; $ x For ($ y = 0; $ y $ Rgb = imagecolorat ($ I, $ x,

PHP multi-dimensional array sorting

PHP multi-dimensional array sorting /* Function: sorts two-dimensional arrays by specified key values. $ Array = array ( 0 => array ('id' => 8, 'username' => 'phpernote '), 1 => array ('id' => 9, 'username' =>

Use PHPMailer to send HTMLEmails with images

Use PHPMailer to send HTMLEmails with images Require ("class. phpmailer. php "); $ Mail = new PHPMailer (); $ Mail-> IsSMTP (); $ Mail-> Host = "smtp1.example.com; smtp2.example.com "; $ Mail-> SMTPAuth

PHP formatting time, several minutes ago, several hours ago

PHP formatting time, several minutes ago, several hours ago // Formatting time, several minutes ago, several hours ago Function format_date ($ time ){ $ T = time ()-$ time; $ F = array ( '20140901' => '

Implemented php class that supports resumable download of files

Implemented php class that supports resumable download of files The example in this article describes the php-enabled resumable object download class and its usage. it is a very practical technique. Share it with you for your reference. The

Returns the regular expression of a number in a string.

Returns the regular expression of a number in a string. $ Patterns = "/\ d +/"; // The first // $ Patterns = "/\ d/"; // second $ Strs = "left: 0px; top: 202px; width: 90px; height: 30px "; Preg_match_all ($

PHP time processing functions-php Tutorial

PHP time processing functions // Mktime () Convert date and time to unix timestamp // Time () Obtains the unix timestamp of the current time. Echo date ("Y-m-d", mktime )).""; //

Php simple verification code creation

Php simple verification code creation $ Image = imagecreatetruecolor (100, 30 ); $ White = imagecolorallocate ($ images, 255,255, 2 ); $ Red = imagecolorallocate ($ image, 255, 0, 0 ); Imagefill ($ image, 0,

Php paging mysql Query Results

Php paging mysql Query Results Function pageSplit ($ startPos, $ rowsPerPage = '', $ totalRows = '') { $ NumPages = $ totalRows/$ rowsPerPage; $ TenthPages = $ rowsPerPage * 10; If ($ startPos >=$

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