PHP implements level three navigation bar effect

1. Data configuration file db.php Return Array ( Array ' One ' = ' About Us ', ' Both ' = Array ( Array ' Three_tit ' = ' Company Introduction ', ' Three_cont ' = Array ( ' Corporate profile ',

PHP dynamically creates functions at run time

The general language function must be defined as running, while PHP supports the dynamic creation of functions at run time, here is a simple example of creating a function $ A with different conditions when moving if (count

PHP Export CSV file code

!--? php //Notice that the include classpath is correct require_once (d Irname (__file__). '/export.php '); $exceler = Newjason_excel_export (); //Generate Excel format here different formats are

PHP to judge a picture of the main tone of the code snippet

This code can help you determine the main color of any image , a simple statistical algorithm is used to implement $i = imagecreatefromjpeg ("image.jpg"); for ($x =0; $x for ($y =0; $y $

PHP finds substrings in the specified string

The Strpos () function can be used to find substrings in PHP. The Strpos () function will attempt to find the location where the substring first appears in the source string. If found, it returns a non-negative integer indicating where the substring

PHP's ENCODE64 Encoding class

Encode64 can obtain the shortest 26 English-size alphanumeric plus "-_" two symbols encoded data, the string can be transmitted freely in the network, without regard to the confusion caused by automatic transcoding. Cons: For large strings too slow,

A PHP script that changes the hosts

Define (' Host_file ', ' C:\Windows\System32\drivers\etc\hosts '); $HM = new Hostmanage (host_file); $env = $argv [1]; if (empty ($env)) { $hm->delallgroup (); } else { $hm->addgroup ($env); }

PHP Calculates date differences

Date_default_timezone_set ("Asia/calcutta"); function Dt_differ ($start, $end) { $start = Date ("G:i:s:m:d:y", Strtotime ($start)); $date 1=explode (":", $start); $end = Date ("G:i:s:m:d:y", Strtotime ($end));

PHP Time processing function

Mktime () Convert date and time to UNIX timestamp Time () Gets the Unix timestamp for the current time echo Date ("Y-m-d", Mktime (0,0,0,12,31,2013)). ""; Example: Calculates the age of a user by calculating the

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

Code can also be used to count the number of catalogs Format output Directory size unit: BYTES,KB,MB,GB function Getdirectorysize ($path) { $totalsize = 0; $totalcount = 0; $dircount = 0; if ($handle =

PHP Simple Image Verification Code implementation

The first snippet generates a random picture------code2.php Open session to save the generated content Session_Start (); $table =array ( "Pic0" = "Dog", "Pic1" = "Cat", "Pic2" = "Fish",

PHP format time, a few minutes ago, a few hours ago

Format time, a few minutes ago, a few hours ago function Format_date ($time) { $t = Time ()-$time; $f = Array ( ' 31536000 ' = ' year ', ' 2592000 ' + ' months ', ' 604800 ' = ' Week ', ' 86400 ' = ' Day ',

Use Phpmailer to send HTML Emails with pictures

Require ("class.phpmailer.php"); $mail = new Phpmailer (); $mail = new Phpmailer (); $mail->issmtp (); $mail->host = "smtp1.example.com;smtp2.example.com"; $mail->smtpauth = true; $mail->username = ' smtpusername ';

Using PHP for short URL functions

function Shorturl ($url) { $length = strlen ($url); if ($length > 45) { $length = $length-30; $first = substr ($url, 0,-$length); $last = substr ($url,-15); $new = $first. " [ ... ]". $last; return $new;

PHP compresses files into zip files

PHP ziparchive is a PHP extension class, you can easily achieve the zip file compression and decompression, before using the first to ensure that the PHP ZIP extension is open. /* Description: A function that compresses

PHP Post JSON data

function Http_post_data ($url, $data _string) { $ch = Curl_init (); curl_setopt ($ch, Curlopt_post, 1); curl_setopt ($ch, Curlopt_url, $url); curl_setopt ($ch, Curlopt_postfields, $data _string); curl_setopt ($ch,

PHP calculates the distance code between two-point latitude and longitude

The following is an analysis of the distance code between the 2-point latitude and longitude of PHP calculation. function Getdistancebetweenpointsnew ($latitude 1, $longitude 1, $latitude 2, $longitude 2) { $theta =

Create a CSV file from PHP data

function Generatecsv ($data, $delimiter = ', ', $enclosure = ' "') { $handle = fopen (' php://temp ', ' r+ '); foreach ($data as $line) { Fputcsv ($handle, $line, $delimiter, $enclosure); } Rewind ($handle); while

PHP calculates the distance between two latitude and longitude

cos

function Getdistancebetweenpointsnew ($latitude 1, $longitude 1, $latitude 2, $longitude 2) { $theta = $longitude 1-$longitude 2; $miles = (sin (Deg2rad ($latitude 1)) * Sin (Deg2rad ($latitude 2)) + (cos (Deg2rad ($latitude 1)) * cos (

PHP Generate fillet Picture code

$image _file = $_get[' src ']; $corner _radius = isset ($_get[' radius ')? $_get[' radius ']: 20; The default corner radius is set to 20px $topleft = (isset ($_get[' TopLeft ') and $_get[' topleft '] = = "No")? False:true; Top-left rounded

Total Pages: 5208 1 .... 3641 3642 3643 3644 3645 .... 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.