PHP lists all tables in the database

!--? php $conn = @mysql_connect ("localhost" , "UserName", "password") or Die ("Sorry-could not connect to MySQL"), $rs 1= Mysql_list_dbs ($conn); for ($row =0; $row Mysql_num_rows ($rs 1); $row + +) { $this _db = Mysql_

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

A simple PHP paging class code

Class Page { Private $total; Total number of records in the data table Private $listRows; Number of rows displayed per page Private $limit; Private $uri; Private $pageNum; Pages Private $config =array (' Headers ' and '

PHP Transparent Watermark Generation

[PHP] code !--? PHP /* * C reated on 2010-10-27 * by QQ542900563 * Copyrights Reserved 2000-2020 * This example shows how the image watermark is generated. /li> */

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 =

The making of PHP simple verification Code

$image =imagecreatetruecolor (100, 30); $white =imagecolorallocate ($image, 255, 255, 2); $red =imagecolorallocate ($image, 255, 0, 0); Imagefill ($image, 0, 0, $white); Munber Create $num = ""; for ($i =0; $

PHP Judge Access IP

Determine Access IPPHP code function GetIP () { if (! empty ($_server ["http_client_ip"])) { $CIP = $_server ["Http_client_ip"]; } else if (! empty ($_server ["http_x_forwarded_for"])) { $CIP = $_server

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 Unzip zip file

function unzip ($location, $newLocation) { if (EXEC ("Unzip $location", $arr)) { mkdir ($newLocation); for ($i = 1; $i $file = Trim (Preg_replace ("~inflating: ~", "", $arr [$i]); Copy ($location. ' /'. $file,

A PHP class for handling cookies

Login Registered Subscribe to RSS Site Map Script Sharing Network Cookieclass Copyright (C) 2005 Jrsofty programming. Http://jrsofty1.stinkbugonline.com Licensed under GNU/GPL Class

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, $y); $r = ($rgb >>) & 0xFF; $g = ($rgb >> & 0xFF; $b = $rgb

PHP Displays the time as "just" "N Minutes/hour ago", etc.

In many occasions in order to show the timeliness of information, the time is generally displayed as "just", "5 minutes Ago", "3 hours ago", and so on, rather than directly print out the time. such as microblogging, SNS applications for the longest

PHP parsing XML data

$xml _string= " Ben A H2o K "; Load the XML string using SimpleXML function $xml =

PHP A simple quick sort

Fast sorting with constant positioning of datum numbers /** * Created by Phpstorm. * User:saint * DATE:15/8/5 * Time: 11:49 */ Class Demo { Public $a = Array (3, 6, 9, 2, 4, 7, 1, 5, 8, 0);

Use IP to determine the PHP code of the city in which the user is accessing

function Detect_city ($IP) { $default = ' UNKNOWN '; $curlopt _useragent = ' mozilla/5.0 (Windows; U Windows NT 5.1; En-us; rv:1.9.2) gecko/20100115 firefox/3.6 (. NET CLR 3.5.30729) '; $url = '

360 PHP anti-injection Code provided

Code by Safe3 function Customerror ($errno, $errstr, $errfile, $errline) { echo "Error number: [$errno],error on line $errline in $errfile" ; Die (); } Set_error_handler ("Customerror", e_error); $getfilter = "' | (

PHP Random Password generator

function Auth_pwgen () { $PW = "; $c = ' bcdfghjklmnprstvwz '; Consonants except hard to speak ones $v = ' Aeiou '; Vowels $a = $c. $v; Both Use the syllables ... for ($i =0; $i $PW. = $c [rand (0,

An algorithm for fast ordering of PHP

Function Qsort (& $arr) { _quick_sort ($arr, 0, Count ($arr)-1); } /** * Fast sorting using recursive algorithm. * * @param array $arr to sort * @param int $low Lowest sort sub-segment * @param int $

PHP Gets the time stamp function for the start of the first day of the specified month and the end of the last day

/** * Gets the timestamp of the start of the first day of the specified month and the end of the last day * * @param int $y year $m month * @return Array (start of month, end of month) */ function

Are you bothered with PHP code audits for how to learn?

this post finally by what look at 2016-7-13 10:34 editThis post is what I see in other forums, it feels very good, so share it and discuss the study with everyone. Author: jing0102In the original: Are you worried about how to learn \ PHP code audit?0

Total Pages: 5208 1 .... 4821 4822 4823 4824 4825 .... 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.