PHP to determine the file type of upload file types of multiple instance code

PHP Tutorial to judge the file types of uploaded files a variety of instance code $array = Array (' jpg ', ' gif ', ' PNG ', ' jpeg '); $PICIMG = '/upfile/upload_pic/thumbnail_1258615556.jpg '; $img = Strtolower ($PICIMG); Get file name extension method One $ext = substr ($img, Strrpos ($img, ' ...

PHP uses Excelparser to import Excel into MySQL database

PHP Tutorial Imports Excel into the MySQL Tutorial database tutorial, using Excelparser class Excelparser {private $_data=array (0, ");     Private $_excel_handle; Private $_excel=array ();

PHP passes query database specified record based on URL parameter

$id =isset ($_get[' id ')? $_get[' id ']: '; if (!is_numeric ($id)) {exit ("<script>alert) (' Sorry, the user you accessed is not saved! '); History.back ();</script> "); }else{$sql = "SELECT * From ...

PHP generates HTML static file class program and instance use method

PHP Tutorial Generate HTML static file class program with instance use method class HTML {var $dir;//dir for the htmls (without/) var $rootdir;//root of HTML Files (without/): HTML var $name; HTML file Store path var $dirname; The specified folder name, var $url; To obtain the ...

PHP gets the current URL domain name instance code

PHP tutorial Gets the current URL domain name instance code function getServerName () {$ServerName = Strtolower ($_server[' server_name ']?$_server["Server_   NAME ']:$_server[' http_host ']); if (Strpos $ServerN ...

PHP saves the uploaded map to the database and displays the code

The PHP tutorial saves the uploaded map to the database tutorial and displays the code//Connect to database $errmsg = ""; if (! @mysql tutorial _connect ("localhost", "root", "")) {$errmsg = "cant c ...

PHP +mysql based on IP to determine the user's city program

PHP tutorial based on IP to determine the user's city program $servername = ' localhost ';   $dbname = ' 8684 '; Database Tutorial Name $dbusername = ' root '; Database username $dbpassword = ' 123456 '; Database Password $link =mysql tutorial _connect ($servername, $dbusername,...

PHP capture Remote Web page images and save to local code

Ob_start: Turn on output buffering ReadFile: reads a file and writes to the output buffer to return the number of bytes read from the file. If the error returns false and an error message is displayed unless invoked in the form of @readfile (). Ob_end_clean (): Clean (erase) of the output buffer and turn off output buffering (clear output buffer)

PHP +mysql User Login Authentication Code

This is a simple user login verification code Oh, more suitable for beginners in PHP tutorial Oh, let's look at the HTML code <form action=111cnnet.php > <input type=text name=username > <input type=text name=password> <input type=submit Name=password ...

PHP regular fetch img tag alt src width Heigh property

PHP tutorial regular fetch img tag alt src width heigh attribute <?php/* Regular take picture any attribute in img tag/$word = ' <p height= ' align= ' cenetr ' >111 22< /p> <img src= "/upload/images/aaa.jpg" &n ...

PHP Infinite Class classification method and code

PHP Tutorial Unlimited class class trees{private $_keyid = ' Id ';  Private $_keyname = ' Name ';    Private $_keyfid = ' Fid '; function __construct ($keyId = ', $keyName = ', $keyFid = ') {...

PHP turns full-width numbers into half-width digits and removes HTML labels

Convert full-width digits to half-width digits function Getalabnum ($fnum) {$nums = Array ("0", "1", "2", "3", "4", "5", "6& ...").

PHP Judge file modification time and date function code

PHP Tutorial to determine the file modification time with the DATE function this script when the page was last revised and output as 20 minutes ago, or XX days before the date ... Or even if you don't update too much-20 weeks before the show!   File Name $last _modified = Filemtime ("file.php");   {$timediff = time ()-$last _modified; if ($ ...)

PHP Judge page program execution time code

The PHP tutorial determines the page execution time code to determine the time required for the PHP script to execute correctly for a microsecond.         Inserts the code at the top of the page: <?php $mtime = Microtime (); &nbs ...

PHP Classic pagination classes apply to all pagination

Classic PHP Tutorial Pagination class-PHP General Page class <?php classes my_lib_pages{private $each _disnums;//The number of entries per page PR ...

PHP Scale Small graph function

PHP Tutorial Scaling Small graph function <?php class My_lib_functions {# ******************************************** # object to array # ************** function Object2array ($obj) {&nb ...

PHP Bulk Filter Illegal characters

PHP Tutorials Bulk Filter Illegal character function testaddslashes ($array) {if (!GET_MAGIC_QUOTES_GPC ()) {if (Is_array) {($array)) {foreach ($array as $ Key => $val) {&nbs ...

Php:time (), date (), mktime () function difference

Php:time (), date (), Mktime () php:time (), date (), mktime () Date and time function library {often forgets} Checkdate: Verify the correctness of the date. Date: Formats the time of the server. Strftime: Formats the server's time locally. GETDATE: Get time and date information. Gettimeofday: Get the current time. Gmdate: Get the present and ...

PHP Get file size function and instance tutorial

PHP Get file size function and instance tutorial <?php function GetFileSize ($url) {$url = Parse_url ($url); if ($fp = @fsockopen ($url [' Host '],empty ($ url[' Port ']: $url [' Port '], $error)] {fputs ($fp, "get". Empty ($ ...)

PHP addslashes processing $_post $_get Array function

PHP addslashes processing $_post $_get Array function This is my one equivalent to an automatic version of the feature used to process the $ _post array useful <?php function add_slashes ($an _array) {foreach ($ An_array as $key => $value) {$new _array[$key ...

Total Pages: 18 1 .... 4 5 6 7 8 .... 18 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.